Hex software: Benzene with Mohex and Wolve, also Six, Hexy, anything else: is anyone maintaining anything? Hex, Havannah

43 replies. Last post: 2018-09-05

Reply to this topic Return to forum

Hex software: Benzene with Mohex and Wolve, also Six, Hexy, anything else: is anyone maintaining anything?
  • David J Bush ★ at 2016-12-17

    There are quite a few engines to practice against, but it seems none of them are maintained any more.

    There are several older threads about one of these engines or another. I hope to revive this general topic and am asking for any up to date info on what method still works.

    My OS is Linux Mint 18 using Mate 1.14.1 and I am particularly interested in MoHex, but any info that might help someone else get a working computer opponent is welcome.

    Thanks very much!

  • Arek Kulczycki at 2016-12-17

    David, I don't know about any. By the way, is any of this valid for windows? I'd like something to analyse the endings. Not for LG games, because that's obviously cheating. Also I wouldn't trust computer more than my assessment.

    With lazyplayer we tried to improve our general knowledge by playing on 15x15, however we reach endgames that we cannot agree who has advantage… even after 1-2 hours of trying different variations.

    Another thing is that probably the exsiting software cannot solve much either in a reasonable time. (say, 15x15 with 40 stones on the board)

  • David J Bush ★ at 2017-03-26

    I got a request from Przemyslaw to relay his question about building Mohex. Apparently, Benzene is now so far out of date that the revision number of the software it needs is no longer archived anywhere.

    “Hey, thanks for reply but I don't have valid account there. Here is my error: http://pastebin.com/RfrN0sZS

    My steps:

    1) autoreconf -i

    2) ./configure –with-boost-libdir=/usr/lib/i386-linux-gnu –with-fuego-root=/root/Desktop/benzene-0.9.0/fuego/ –enable-upto13x13=yes4)add -pthread and -lpthread to BOOST_THREAD_LIB in config status3) make

  • EJCT at 2017-03-26

    Try this:

    In file src/Hex/BoardUtil.hpp Line 53:

    change

        HexPoint RandomEmptyCell(const StoneBoard& brd);

    to

      HexPoint RandomEmptyCell(const StoneBoard& brd, SgRandom& random);

    In file src/Hex/BoardUtil.cpp Line 107:

    change

    HexPoint BoardUtil::RandomEmptyCell(const StoneBoard& brd, SgRandom& random)

    {

        bitset_t moves = brd.GetEmpty() & brd.Const().GetCells();

        int count = static_cast(moves.count());

        if (count == 0)

            return INVALID_POINT;

        int randMove = SgRandom::Global().Int(count) + 1;

        for (BitsetIterator p(moves); p; ++p)

            if (–randMove==0) return *p;

        BenzeneAssert(false);

        return INVALID_POINT;

    }

    to

    HexPoint BoardUtil::RandomEmptyCell(const StoneBoard& brd, SgRandom& random)

    {

        bitset_t moves = brd.GetEmpty() & brd.Const().GetCells();

        int count = static_cast(moves.count());

        if (count == 0)

            return INVALID_POINT;

        int randMove = random.Int(count) + 1;

        for (BitsetIterator p(moves); p; ++p)

            if (–randMove==0) return *p;

        BenzeneAssert(false);

        return INVALID_POINT;

    }

  • lazyplayer ★ at 2017-03-26

    If you find how to make it work, then please contribute the instructions here: http://hexwiki.amecy.com/index.php/Computer_Hex

  • EJCT at 2017-03-26

    I am going to take part of MoHex code improve it and release as new software for Windows. MoHex is very weak in openings and I believe that it is possible to improve it.

  • lazyplayer ★ at 2017-03-26

    Critical, will you release your as open source or not?

  • EJCT at 2017-03-26

    Open source:)

  • piens at 2017-05-03

    Neurohex crushes all of those easily head-to-head. It might be unbeatable. https://github.com/kenjyoung/Neurohex

  • EJCT at 2017-05-06

    I don't think so

  • piens at 2017-05-06

    Ridiculous statement without proof on your part. I have Hexy, Six, and Benzene/Mohex. Neurohex will beat any of these (I've tested on both Mac and Windows) second move with no swap, and easily, 100% of the time 6 games a piece for each of the mentioned software. I find people just don't understand AI and Neural Nets….. Mohex is Monte Carlo. When a neural net plays itself, it is basically doing a Monte Carlo and storing it in the Q-matrix, or policy matrix. It will always win given enough optimization time. If you were to ever beat Neurohex, with the pre-optimized net in the program.py engine, you simply let it play itself two weeks, and it will be beating its old self 100% of the time. Also, the guy who did this used Mohex to optimize his matrix the first time - it's in the readme.

    This has nothing to do with hex, which is a beautiful. AI will beat humans and tree-search algorithms for any game or task, anytime, given enough optimization.

  • HappyHippo at 2017-05-07

    I played a few games against it, it was good for a computer but I could beat it easily.

  • lazyplayer ★ at 2017-05-07

    piens, given enough time, PVS also converges to perfect play. Your is rather silly argument… ;)

  • simpledeep at 2017-05-07

    https://arxiv.org/abs/1604.07097

  • z at 2017-05-07

    “After two weeks of Q-learning, NeuroHex achieves win-rates of 20.4% as first player and 2.1% as second player against a 1-second/move version of MoHex, the current ICGA Olympiad Hex champion.”

  • Gwylim Ashley at 2017-05-08

    It seems like the version described in the paper doesn't use tree search, whereas the current version on github does, so maybe the winrate is better now.

  • David J Bush ★ at 2017-05-08

    Could someone who has Neurohex working please provide a clue? My OS is Linux Mint using Mate 64 bit. I installed numpy and theano using miniconda. I used git clone to copy Neurohex to a subdirectory of my home directory. I can find no build instructions. Is there some Python equivalent to configure and make? TIA

  • piens at 2017-05-09

    Basically you use hexgui (the java bin) to start, then under program/engine, you have a command “python program.py” which runs the engine. It can play 11 or 13 size. Y

    es, z and gwylim, the paper is refering to the q-policy network training and performance. For the github he uses the neural net to find the board evaluation, then does a tree search with the evaluation function. This is how alpha smart go worked, the computer is trained to evaluate the likelihood of a win from a position, and this 'learned' evaluation function is used for a tree search. Chances are an expertly designed evaluation function may perform better, as in chess computers. But it out-performs hexy or mohex on my system. Hexy is so fast on a modern computer, and neurohex takes about 5-10 sec per move. i would like to see hexy allowed equitable time.

  • piens at 2017-05-10

    Just a note - Neurohex is also old. It's python 2.7, and python 3.6 is out, the calls to tkinter and the print function have to be changed or you have to install legacy python on your path.

  • ypercube at 2017-05-10

    2.7 is not legacy, it's still used a lot.

  • David Milne at 2017-05-10

    Yes, Python comes in two main tracks which continue side by side. 2.7 gets gets favoured for a different range of applications than 3.6. The nice & neat brigade would like to see the 2.x series retired with only the 3.x series remaining. But we do not live in a nice & neat world :-)

  • simpledeep at 2017-06-12

    any progress being made here? Maybe someone can help me get one of these working in windows… I would love something like hexy that could play better on larger boards.

  • piens at 2017-06-14

    Neurohex is the same strength as Hexy more or less, and you can do 13x13 or 11x11. Just go to the github link and follow the instructions. It works pretty well. Thing is, hex AI is not easy. I did a project on github in Lisp that was ok on small boards, but too easy to beat, even for me and not that good. I've tried Rust, Python, and some others. The hex space is so large, it's quite challenging to make AI, and humans still easily crush it. I think human play is best, after maybe using hexy to get up to speed. There are always hex games here! :)

  • piens at 2017-06-15

    I don't know if you ever read the original paper about Hexy - it's quite brilliant! https://www.aaai.org/Papers/AAAI/2000/AAAI00-029.pdf Hexy is interesting in that it uses an automatic theorem proving approach to Hex. The limitations are that his H-algorithm doesn't detect all virtual connections. I think it's going to be hard to improve upon the basic approach of Hexy. I think a fruitful approach would be a faster, more comprehensive algorithm than the H-AND/OR set-building algorithm. I think one should train a neural net to classify virtual connection between any two vertices, then use an alpha-beta search on the grid resistance from that. I'm working on such an approach, but really it's a full-time job, either a thesis (as Hexy) or commercial enterprise. Much like Go AI, time, programming precision and domain knowledge would all be required to produce an above-intermediate level player. It would be a very comprehensive and time-consuming project. Maybe a collaborative open-source endeavor possibly at least.

  • apetresc at 2017-09-05

    This seems like a good place to mention: I went through the old Mohex and Wolve code and updated it to run with modern C++/Boost/Fuego libraries. As far as I can tell, it works just as well now as it did back in ~2008, withough the need to install old compilers, etc.

    You can find it in the apetresc branches at http://github.com/apetresc/fuego and http://github.com/apetresc/benzene, and if you use a distribution that supports PKGBUILDS (i.e, Arch Linux), a fully-featured build is up on AUR at https://aur.archlinux.org/packages/benzene-mohex/ and https://aur.archlinux.org/packages/benzene-wolve/

    Enjoy :)

  • apetresc at 2017-09-05

    (And I should mention: my AUR package for hexgui is also compatible with both Wolve and Mohex: https://aur.archlinux.org/packages/hexgui/)

  • simpledeep at 2018-06-14

    check this out! :

    https://notes.jasonljin.com/projects/2018/05/20/Training-AlphaZero-To-Play-Hex.html

    https://github.com/likeaj6/alphazero-hex

  • fritzd at 2018-06-15

    There are already (at least) 4 AlphaZero type bots here: fastplayer, gzero_bot, leela_bot and of course simpledeep. Maybe time for a bot tournament?

  • leela_bot at 2018-06-17

    bot user tournament created. Humans are welcome to join also :)

  • simpledeep at 2018-06-17

    beep boop beep ;)

    I actually play by my skill alone, and have no background in AI. But I'll take that statement as a compliment. Brian “the machine” Wittman has a nice ring to it…

  • gzero_bot at 2018-07-01

    Tournament underway…  good luck to all the participating bots. :)

  • Arek Kulczycki at 2018-07-02

    They're doing really well, I've got to say…

  • apetresc at 2018-07-03

    Does anyone have any details on leela_bot? I can't find a Leela-Zero equivalent for Hex on Github, is it a private project still?

  • Arek Kulczycki at 2018-07-07

    Spoiler alert, I'm gonna leave a short comment about the ongoing games.

    It seems mohex and wolve are playing their usual stuff, which I consider total nonsense. On the other hand there are gzero and leela both of which honestly play good hex!

    So it seems it will come down to two interesting games between gzero and leela. I somewhat appreciate leela more, but the games are quite equal.

    1) leela on white (currently move 22) seems to be going this way and I think probably gzero wins, but it's complex.

    2) leela on black (currently move 22) I think leela was in huge trouble after top-left dubious joseki, but then gzero made this error and now maybe leela has a chance but has a tough choice in the center-right area. Tough for me at least, maybe the bot has it's ways to conclude those positions. I would experiment with 23.i6… a “default” play leads to good position for black

    To conclude, I support leela, but put my bet on gzero :)

  • shalev at 2018-07-08

    If leela gets the next move right on white (current move is 37, it needs to get move 38 right), it should win. If that happens, we might be looking at a tie between leela and gzero (Leela has pretty much no chance on black).

  • shalev at 2018-07-08

    Actually there are probably several winning moves for leela on white, not just one. So maybe both games are basically over. And from the looks of it they both win all their other games (I might have missed one).

  • gzero_bot at 2018-07-09

    Seems gzero caught stage fright and played some random moves.  Both games against Leela are close to resigning now.  He also got himself in trouble with the wolve game. Sorry to mess up the analysis.

  • leela_bot at 2018-07-09

    leela knew it was in trouble at move 37.g8. It figured it had a 40% chance of winning. Here is how it expected the game to continue. ggs gzero!

  • shalev at 2018-07-10

    By the way, leela's move 35. d8 in that game is horrendous; it's a move that's provably suboptimal, because if gzero responds with 36. e9 leela's stone becomes provably useless (in fact it would be equivalent to leela's stone not existing). The only reason to ever play a move like 35. d8 is if you already know you lost and are hoping your opponent will flag or misclick or something. (Of course, gzero responded with 36. e10 instead of 36. e9, which is also bad, but maybe gzero saw that it wins either way.)

    So if leela only knew it was in trouble at move 37, it means it played move 35 without realizing it's a worse than useless move…

  • Arek Kulczycki at 2018-07-12

    I'm not sure what has eventually happened in those endgames, but I liked leela's openings better so I congratulate the wins :)

  • David J Bush ★ at 2018-07-14

    My OS is Linux Mint 18.1 with Mate. I used git clone to download the files. I have Python 3.6.0. I tried to follow the README.md instructions. I tried python3 sl_bootstrap.py and got ModuleNotFoundError: No module named “keras” Then I tried python3 Hex.py and got the same error. Any clue is appreciated.

  • Arek Kulczycki at 2018-07-14

    pip install keras doesn't work for that matter?

  • fastplayer at 2018-09-05

    https://github.com/cgao3/benzene-vanilla-cmake

    The above link is to MoHex 2.0 and Benzene. It has been reorganised using CMake, installation is super easy now!

    MoHex 2.0 is now “weak” (except on small board sizes <10x10 ), compared to those with neural nets.

    Very likely, the 2018 Computer Olympiad version of MoHex with neural nets will be open source soon.

Return to forum

Reply to this topic