Dagaz: Errors

    imageThe work of helping the drowning is the  
    work of the drowning themselves.

    I. Ilf and E. Petrov.

     
     
    Mistakes are mistakes. While working on the project , I maintain my personal error rating . Something is fixed very easily, at the first start, something is tightly nailed to architecture and therefore has been poisoning life for years. Some errors just freeze. When you correct them, you feel that you are living. I love such mistakes.

    Writing the same games all the time would not be interesting. Fortunately, the games are different. Some games are more different than others. Honestly, I undertake something for them, mainly because of the uniqueness of their game mechanics. For me, such games are a kind of challenge.


    Hanga roa
    This game breaks stereotypes and breaks patterns. Do not be fooled by the superficial resemblance to Chess . It is completely different from Chess. The goal of the game is to lead your “ Moai ” to the opposite edge of the board. That's just, in itself, Moai does not know how to walk on the board. This figure walks only “on pebbles” (strictly of its own color), moving to one adjacent cell in any of eight directions (the used stone is removed from the board). The steps can be repeated as long as possible.

    Matatoa(on the board it looks like a pawn) it also moves one step in any of eight directions and can destroy enemy "roads" by taking stones of someone else's color (of course, it can also move along empty fields). Otherwise, “chess capture” is not used in the game, the pieces are removed from the board in a completely different way. To remove a piece from the board, it is necessary to surround it with its stones in such a way that it cannot move (it is obvious that it is impossible to catch MataToa in this way). If you managed to surround Moai - the game ends here. With Ariki , the last remaining figure, things are different.

    Ariki- the figure of a builder (depicted as a rook on the board), which throws those same “pebbles” onto the board. The move is carried out as follows: the piece moves any distance in any of eight directions (like a chess queen, only without a fight), after which it fires two “shots”. Stones also fly at any distance, in any of eight directions. If you manage to stone the enemy Ariki with stones , she is removed from the board, but not forever. The player to whom she belongs can put her on the board again, in one of the following moves, but only on the first horizontal. Perhaps this is the most amazing chess mechanics I have ever seen.

    It's all about these very "shooting" figures. The “shot” itself is encoded quite simply, but in order to have the opportunity to “shoot” twice in a row, I had to climb into the core . The fact is that since the time with Zillions , such a sequence of actions has been interpreted as a composite move, that is, a sequence of partial moves performed by one piece, and a “shot” is, in fact, moving the same piece to another position. Not the one with which the next partial move should be performed (second "shot"). I had to tinker with this.

    Since I have not yet figured out how to implement a bot for this game, I made it in the “smart board” mode, which controls the observance of the rules, but without game AI. It played a trick on me. The error did not manifest itself at all in the manual control of the figures, but it became obvious as soon as I started making a bot for the Amazons .

    Strictly speaking, there is another game with similar mechanics

    But for her, I did not make a bot either. I think you understand why.

    In the case of the Amazons, I found a workaround and did not climb into the core, but for Hanga Roa this solution was not suitable. Since there was still no bot for the game, I threw this thing in a long box (and it continued to bite me from the inside out). It would have continued like this if, while working on Quantum Morris , I hadn’t stumbled upon such filth here:


    The problem was aggravated by the fact that the error, apparently, manifested itself depending on the phases of the moon. This (as well as a number of other cases) clearly showed that the time has come to rewrite the animation code for moving shapes, from which the project almost started. Do not get me wrong, I did not rush to rewrite view immediately. I convinced myself that this was necessary, for about a month. And in the end, convinced . The code has become simpler and more understandable. Along the way, other errors that tormented me for a long time became more obvious.


    The picture is clickable. Admire how the black ball, having completed the course, turns into white (although it should not do this at all). With the old view, it remained black and the error was not so obvious. On the view, the figure remained black, but the player could no longer control it (since, in the model, it was white) and it infuriated. Strictly speaking, this is a model error, but many questions have already accumulated to it (as well as to the utility for converting ZRF code into JavaScript).

    For good, everything needs to be rewritten there, but I'm not mentally prepared for this yet. Therefore, I made another " quick fix " and in Fanorona , now, you can play normally, without accompanying miracles. In " Russian Checkers ", by the way, too. There was a bug related to the implementation of the Turkish strike rule.", unexpectedly easily fixed by this simple fix. So I work on the bugs. So I make the project better.

    Also popular now: