Artificial Intelligence Naval Battle - Honestly

    screen.png - upload images with PicamaticOnce such a booze went (respect!), I decided to put my craft in the open source - the game of sea battle. The project is hosted on googlecode. There is SVN there . In addition, the source code and the Windows assembly can be taken directly from my home computer (why so - under the cut). Key features:
    • written in Qt - runs anywhere (and only basic features are used, you do not have to install any QSvgRenderer)
    • has several options for the rules (need more? - write! :-))
    • plays honestly (that is, when inventing a move, the computer does not peep into your field)
    • automatic and manual placement of ships and other trifles
    Actually, this is all that I give to humanity, but ... in return, I hope for some feedback ,-)

    Caution - Habraffect! :-)
    Colleagues! Now, from my home computer, there are more than a hundred downloads simultaneously (more than a hundred connections are served). Downloading the Windows distribution may take 10-20 minutes, not all browsers can handle it :-) Use downloaders, or wait for the habra effect to decline.
    Once again I apologize. I could not have expected such a Kachalov. Already more than 1000 downloads :-). Waiting for your comments. Thanks!


    Threw out hastily :-)
    You can take everything not from home!
    Sorci
    Under Windows
    (more than 3000 copies have already been downloaded from the house :-) I expected, well, a maximum of 100 :-))


    pfactum reports that it did not collect from Linux under Linux and the problem was solved by adding the line "#include to src / logic / arena.cpp". Apparently, the problem really takes place. If someone else has such problems, write.

    First of all, thanks for any comments, but some comments will be more valuable to me than others :-)

    Now it’s most important for me to discover
    • possible inconsistencies in the program (for example, if you can shoot at the enemy even after the end of the game)
    • possible typos in messages
    • any suggestions are made that make the message more understandable
    Good: "the application has no icon." Good: "the word has is written in the wrong case." Such suggestions will be immediately taken into account. Suggestions like “it would be good to rob ships and rape sailors of both sexes” will be considered no earlier than 2012 :-)

    Now a few words anticipating the questions.

    Will there be assemblies for my favorite OS?


    I have three news: bad, good and another good.

    Bad: I already created several opensource projects and came to the conclusion that I am not able to support the current builds for all OSs alone. For this project, I basically will not lay out the assembly.

    Good: I found that there are people for whom it is not difficult to upload assemblies, packages, ports, builds ... for their favorite OS.

    I really hope that this little program has connoisseurs who take the humble work of collecting and laying out binaries. I am grateful to post links to these assemblies on the project website.

    In addition, I am sure that users of the appropriate OS and distributions will be able to design binaries in the spirit and style of these OSs. For example, what have I done for Windows users? - stupid zip archive with exe-shnik and necessary dlls. And the right way, probably to make msi, or some installer. In order for the binary to be placed where necessary, for icons to appear, so that the OS knows about the new software and can update it and / or remove it ... I don’t know how to do this. And to master such art for everyone and everything ... no - I'm not able to. I think that everyone will benefit if I do not take on an excessive burden and make clumsy assemblies. Let the professionals do it.

    And one more good news: for the current version I have assembled a screw assembly and you can pick it up from my home machine:-) I'm sitting on a stream, so (1) the speed to return is not very high, and (2) the connection is broken once a day. I apologize for the inconvenience :-)

    What a perversion !? Why not put the binaries and sources on the same googlecode?


    Well, with binaries, I have a principled position (see above), and I will definitely post the source files in the form of an archive when I release the final version 1.0. While you can take them from Google SVN , or as an archive from my home computer . I just don’t want to clog the download section with pre-release versions. In googlecode, nothing can be deleted from the download section; I don’t want development options to be kept there forever.

    I looked at your code ... it's weird


    Oh yeah. In order to at least partially dispel the surprise of those who have looked into the code, I will tell its story.

    Pearl era. A few years ago, I wrote on the knee the web-application “Sea Battle”. It was (it is still alive) created on the pearl. The logic included several significant simplifications, which sometimes led to inadequacies, but this could be ignored. Wrote and abandoned.

    The era of python. More than a year ago, I went to google developers day 2008. Before this, I decided to try GAE. I did not come up with anything new, but rolled over the pearl code in Python. He combed it slightly, slightly erased the protocol of interaction with the server ... But no fundamental changes occurred - only a change of language.

    The era of python: turmoil.It became pleasant to work with python with a code, and I decided to try to do something interesting. (Yes, - I forgot to say, - GAE did not inspire me and I abandoned the GAE project; why didn’t I inspired, I can tell you in the comments, but not about that now.) I decided to do a hexagonal naval battle. Not square cells, but hexagonal honeycombs. To make it convenient to work with honeycombs, I wrote several classes, and the work turned out to be fantastically easy. I really liked the ideas underlying this code, they more than met my expectations. But the game was not interesting, the usual naval battle is much more interesting. Therefore, I also abandoned this project.

    Era Qt. In the summer oflast year I had to ... in short, at work, I came across Qt and I really liked many of Qt's ideas. I decided to rewrite my Python hexagonal miracle into a classic Qt / C ++ naval battle. The class structure was taken from the Python prototype - nothing had to be invented. All logical “simplifications” that led to the crazy game of the computer were eliminated. It was screwed Qt and GUI. Now we have what we have. All logic is written as an independent library. It does not require either Qt, or even STL. However, here the classes are stuffed in files most strangely. And in some places the code requires "si-plus-plus-pizatsii" :-) This is due to the Python background of this code.

    screen-webb.png - image uploaded to Picamatic



    The entire GUI is written in Qt. Here, memory management is completely at the mercy of the Qt mechanism, and signals rule everything. If you want to rewrite the GUI, then this is very easy! It is enough to support the processing of only a few signals.

    In addition, there is a Qt class that controls the course of the game. It stores the state of the game, receives signals from the user and transmits them to the GUI. Strictly speaking, the matter would be a little simplified if this class were divided into two ... but it would be more correct, probably, to use a state machine ... in general, and there is something to fix :-)

    That's all. Every single detail of this unit stores some historical rudiments and / or traces of hasty and not very accurate spelling. However, everything together is arranged rather harmoniously, and if I have courage, I will slowly rewrite everything. However, now we have a fully working version of the program. Putting it out I would like
    1. to please people now
    2. understand whether something else needs to be further developed, or abandon this project, as well as all its predecessors.
    All success in the fight against artificial intelligence in the open sea! :-)

    Also popular now: