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

30 replies. Last post: 2018-06-17

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:


        HexPoint RandomEmptyCell(const StoneBoard& brd);


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

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


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


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

        int count = static_cast<int>(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;


        return INVALID_POINT;



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


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

        int count = static_cast<int>(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;


        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


  • 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! :



  • 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...

Return to forum

Reply to this topic

Include game board: [game;id:123456] or [game;id:123456;move:20] or [game;id:123456;move:20;title:some text]