new tool for reviewing LG hex games (alternative to trmph) Hex, Havannah

84 replies. Last post: 2022-06-16

Reply to this topic Return to forum

new tool for reviewing LG hex games (alternative to trmph)
  • Tom Ace at 2020-09-01

    I have set up a web page for reviewing and analyzing Hex games played on LG.  It lets you play variations and maintains a tree like jhex does.  It's roughly the same code I presented a demo of a while back, but this time with the ability to grab games by number from LG.

    https://minortriad.com/ahex.html

  • lazyplayer ★ at 2020-09-01

    Tom, great tool, the analysis is lost when we close the browser?

  • Tom Ace at 2020-09-01

    It's a work in progress.  I am still working on code to save analysis but for now it's lost when you close the browser.

  • lazyplayer ★ at 2020-09-02

    Yes maybe saving it in a cookie or something? This way it would remain purely client-side. I've asked Richard to change the link from trmph to your page because as it is now it's already better than trmph!

  • lazyplayer ★ at 2020-09-02

    If possible then you should consider donating to littlegolem.net, perhaps in exchange of a lifetime membership… :)

  • Richard Malaschitz ★ at 2020-09-02

    It is now implemented on click. Thanks !!

  • lazyplayer ★ at 2020-09-02

    Richard, thank you, please don't forget hex19.

  • lazyplayer ★ at 2020-09-02

    Tom, I'm using it for a game right now and it's extremely pleasant to use! Simple and effective!

  • HappyHippo at 2020-09-02

    Excellent work Tom!

  • Arek Kulczycki at 2020-09-02

    Thank you Tom and Richard! :)

  • gi0cam at 2020-09-02

    Thanks!

  • Tom Ace at 2020-09-02

    Thanks to all for the kind words, and thanks very much to Richard for setting up the link.  I'll let you know when I have more features ready (e.g., saving analysis).

  • brzy at 2020-09-02

    Thank you Tom Ace.

    Are you planning to develop the feature of analyzing and reviewing Havannah games?

  • Bill LeBoeuf ★ at 2020-09-07

    Thanks Tom, you're the best !

  • Boguslaw at 2020-09-08

    Thank you.

  • apetresc at 2020-09-09

    Wonderful tool - thank you! :)

    Now any chance you can also implement trmph's Havannah support too? ?

  • Tom Ace at 2020-09-11

    The next version will support load/store and a few other additional features.  I'm still working on it and I'll release it as soon as it's ready and tested.

    Yes I plan to support Havannah at some point but other improvements will come first.

    Thanks to all for the kind words of support!

  • Arek Kulczycki at 2020-09-12

    @Tom, your tool is awesome and it's so awesome that I'm worried it will solve 13x13 for good when we start sharing all the analysis… I don't know if it's good or a bad thing, but I'm getting sentimental :)

  • add3993 at 2020-09-13

    Building on Arek's comment, ambitious feature request: ability to use it with engines, i.e. to send moves to an external, offline bot software and receive moves for display, along with comments.  If you provide a suitable interface, we may get easily-usable superhuman bots more quickly.  Which would be stupendous.

  • lguser at 2020-09-14

    yes, add's suggestion is something that will revolutionize hex gameplay like nothing else can

  • HappyHippo at 2020-09-15

    While that would be a nice feature for a hex viewer, I don't believe it should be integrated into the “official” linked analysis viewer. LG having the analysis link right by the game implies that it's ok to use that software when selecting your move. We wouldn't want to imply that it's acceptable to use computer analysis in deciding your move.

  • Bill LeBoeuf ★ at 2020-09-18

    Tom, when do you think that load/store feature will be available?  I would really like to be able to preserve my analysis.

    Thanks again for an awesome tool!

  • Tom Ace at 2020-09-19

    Load/store will be available within a week.  I wanted to deliver it sooner but I ended up reworking the code a bit in getting it to support transposition, and in providing a means to merge trees.

  • Bill LeBoeuf ★ at 2020-09-20

    Great!

    Yes, the program the program seems to have a problem when it tries to handle  a transposition.

  • Tom Ace at 2020-09-24

    A new version is available, accessible from the links on Hex games here on LG (thanks again, Richard!) or directly at https://minortriad.com/ahex.html

    Today's release has bug fixes, it handles transposition, and it reads/writes files.  For details, please read the documentation available via the help button in the drop-down menu.

    Thanks to everyone.  I appreciate all the feedback I've gotten.  I plan to add more features with time, including support for more board sizes.  If a suggestion you made isn't in this release, be assured that I do still have it in mind.  I'm trying to make the most urgent changes first.

    I'm happy to answer questions.  If bugs show up, I definitely want to fix them.  Please let me know if you see any problems.

  • HappyHippo at 2020-09-25

    Hi Tom,

    Great work! Handling the transpositions is a cool feature.

    Is there a link to start with a blank board? https://minortriad.com/hexa.html seems to be the “old” site.

  • Tom Ace at 2020-09-25

    Thanks HappyHippo.  Yeah I moved filenames around but from now on they should be stable.  For a blank board, https://minortriad.com/ahex.html

  • Boguslaw at 2020-09-25

    Thank you, Tom, it is really great and very helpful !

  • Arek Kulczycki at 2020-09-25

    Oh, you can remove the last stone by clicking on it again, I love it :)

  • Bill LeBoeuf ★ at 2020-09-25

    Tom, fabulous work!

    Tom, on Write could you set an option for Replace file vs. Duplicate file…

    Great program!

  • Tom Ace at 2020-09-26

    Bill, I don't know of a way to replace files on write. A  JavaScript program running in a browser doesn't have direct access to the computer's file system.   The only way I know of for the program to write a file is to pass it to the browser as a download and at that point it's out of my hands.  Browsers typically don't overwrite files but instead save with a version number appended to the filename and I don't know of a way to change that behavior.

    If any JavaScript programmers here are aware of another option, please let me know.

  • HappyHippo at 2020-09-26

    Nah, that's basically it AFAIK. Letting a website have access to the user's files would be a security issue, to put it mildly.

  • HappyHippo at 2020-09-26

    The only other thing to do would be to turn your code into an Electron app, but I prefer the convenience of a website.

  • Tom Ace at 2020-10-08

    A new version is available with Havannah support and a few new features.

    Bill LeBoeuf asked if overwrite was possible on saving files.  I still don't know of a way to do that when writing to your computer's filesystem but I can offer the next best thing:  the option of writing to browser local storage.  See the help file for details, but briefly:  local storage is browser-specific (it can't be shared across several computers or browsers) but it makes saving graphs simpler (with overwrite).

    I also added bookmarks.  When a graph has lots of branches it can be tedious to navigate to the line(s) where the latest action is.  Now you can mark one or more positions and return to them.  The –> and –>br buttons are no longer grayed out when there are multiple ways forward and they choose a branch that leads to a marked position if there is one.  The help file has full details.

    If you're not seeing the new version, hold shift down while clicking reload.  Some browsers don't download the file on a plain reload.

    Havannah pages don't have links (yet) but you can always enter a game number on the page at https://minortriad.com/ahexlg.html

    Large boards take up a lot of space on a screen.  I plan to support multiple cell sizes but that's not ready yet.  Until then, use browser zoom as needed.

    I'm happy to answer questions.  If there are bugs, I definitely want to fix them.  Please let me know if you see any problems.

    Thanks to Richard Malaschitz for maintaining LG and thanks to everyone playing here.

  • eobllor ★ at 2020-10-09

    Really nice features, thanks for this!

    How do your engine know the game (Hex or Havannah) from the id? As far as I know, the game is not indicated in the SGFs found in LG.

    As regards saving files, wouldn't it be adequate to have a button display a text version of the game tree and leave to the user the task of saving it as a file? Then the text obtained that way could be later pasted on your page and parsed to recreate the game it represents; if it goes as GET variable in the url of the resulting page, the game could even be shared with others.

  • gi0cam at 2020-10-09

    Thank you for the bookmark feature, I think it is extremely useful!

  • Christian K at 2020-10-09

    This is great! Thanks. If you are looking for suggestions, I would absolutely love to see Dots and Boxes there. This was my main use of trmph.com

  • David J Bush ★ at 2020-10-09

    Thanks for adding Havannah!

  • Tom Ace at 2020-10-09

    eobllor:  It recognizes Havannah games by whether there are digits in the moves.  LG formats Havannah moves as A1, B14, … and Hex moves as aa, bn, … .

    I'm not seeing what advantage cut/paste would have over the existing ability to read/write files.  It's easier to make errors cutting and pasting.

    Christian K:  I hope trmph comes back at some point.  For now, I'm not planning to add more games.   Adding Havannah wasn't hard because of how much it has in common with Hex.

    David:  you're welcome :)

  • Bill LeBoeuf ★ at 2020-10-10

    Tom, thanks for the new version, the old version was already great.

    Your work is absolutely phenomenal!

    Thank you.

  • gi0cam at 2020-10-11

    I have a suggestion for a little improvement: it would be nice, when opening a board via the LG link, that it automatically marks the last move too. After all, that is the starting point of the analysis, and one should be able to quickly go back to it.

    In any case, I think that this really is a great tool.

    Thanks again!

  • Tom Ace at 2020-11-11

    I installed a new release today.  It offers two zoom levels (selectable in the drop-down menu) and supports all Hex board sizes from 10×10 through 19×19.  Please let me know if you encounter any problems.

  • add3993 at 2020-11-13

    Enjoying the tool!  It would be great if when you open the game from its LG page, and start exploring a line of play, the current position were marked as such so that when you click “<- br” it takes you back to the current move (as one tends to hope/expect) rather than the beginning of the game.

    I also would prefer that the LG link to minortriad open in a new tab in the browser, though I guess this is up to Richard.

  • Tom Ace at 2021-04-09

    I uploaded a new version (2.2) today.

    New features:  automatic marking of current position in games imported from LG (suggested by gi0cam) and winning position detection.  As always, please let me know if you have questions, bug reports, … .

  • gi0cam at 2021-04-28

    thank you Tom!

    I tried it out, and I think it works great :)

  • David J Bush ★ at 2021-04-30

    Do you mean, 100% complete winning position detection?

  • Tom Ace at 2021-04-30

    Yes, correct win detection in both Hex and Havannah.  Havannah wins are annotated with a description at the top on the window (Y, bridge, or ring).  If anyone encounters a problem with win detection (false negative, false positive, win type improperly annotated, …) please save the game tree to a file, send it to me, and I'll fix my code.

  • Tom Ace at 2021-06-02

    I uploaded a new release (2.3) today.

    Because ladders are tedious to add by hand, version 2.3 has automatic ladder continuation in Hex games. Each right mouse button click (with the cursor anywhere in the board area) adds a move to a ladder. The two previous moves must be adjacent (and unambiguous, i.e. no transposition). The code to recognize ladders might not always do what you want; if not, click delete to remove the stone it played, play one more stone in the ladder and click the right button again to give the program another chance to recognize the ladder you had in mind.

    Version 2.3 shows a clickable list of moves in a box to the right of the board. The move played to reach the currently-displayed position is marked with a lozenge symbol (⧫). Move numbers for bookmarked positions are displayed in red.

    When there's only one line of play (no branches), it's unambiguous which list of moves to display.  When there are branches in the game's graph, a line of play after the currently-displayed position that leads to a bookmarked position is preferred over one that doesn't; otherwise, it chooses the branch leading to the most recently viewed position.  This is consistent with how the program chooses one of multiple branches forward when you click the —> or —>br button.

    As always, please feel free to contact me with bug reports, suggestions, etc.

  • lazyplayer ★ at 2021-06-02

    Tom, one possible improvement: when we press the forward button, I would like to forward to the best move (most analyzed winning one), not a bad one.

  • lazyplayer ★ at 2021-06-02

    I also don't know and don't understand what is “marking”… what's the point? :D

  • lazyplayer ★ at 2021-06-02

    I also would prefer moves ordered in descending order not ascending… right now the game is displayed upside down…

  • Tom Ace at 2021-06-02

    Marking is putting bookmarks at pages of a book.  It lets you come back to key position(s) quickly after playing through a number of variations.

    About the two suggestions:  I'm interested to hear what everyone prefers and see if there's any consensus.  The move list order follows the example of trmph.com but I'd be happy to change it if more people would prefer it the other way.

  • shalev at 2021-06-02

    Thanks Tom!

    I had an unrelated feature request: can we get keyboard shortcuts for all the buttons? I still sometimes use trmph just for the keyboard shortcuts…

  • eobllor ★ at 2021-06-03

    A really great tool, thanks (-:

    Like Shalev I'd like to have keyboard shortcuts.

    Yet another unrelated feature request: would it be possible to add the option to hide the hollow stone that mark the next move when not at the end of a branch? I sometimes find it slightly confusing when reviewing a game.

  • Tom Ace at 2021-06-03

    Thanks for the suggestion to add keyboard shortcuts.  I coded this today but I'm interested to know which shortcuts people want before releasing it.  For now I implemented the same four that trmph has: n,p,l,f for next, prev, last, first.  Also, I have the left+right arrow keys set to prev+next, and the down+up arrow keys to brbr .  My preference is to not have keyboard shortcuts for actions that change things (delete, set advantage, …) because it's easy to hit keys by mistake.  Please let me know what you think.

    Also, interesting suggestion to optionally disable hollow stones.  It's easy so I'll do it.

  • Arek Kulczycki at 2021-06-04

    Amazing job Tom!

    I also have one request if I may, pls make the UI elements not selectable, I guess something like user-select: none;

    I keep involuntarily selecting something.

  • Tom Ace at 2021-06-04

    Arek:  “user-select: none;” does fix this and I will put it in the next release.  I don't do much work in HTML so I don't know all the tricks.  Thanks very much for telling me about this!

  • Arek Kulczycki at 2021-06-05

    Awesome, thanks!

  • lazyplayer ★ at 2021-06-05

    Tom, now I understand and marking is in fact the proposed solution for my problem. I should mark my preferred position and then the forward button will pick that. Correct? Well then I would recommend we have two buttons, “next mark” and “previous mark”, instead of a single button for “going to the mark”. I would also change “mark” to “preferred” or something like that.

    But in all honesty this is not exactly right, because there could be two positions, so that in one position the “marked” position is the “right” successor and in the other it isn't. Maybe the proper solution is to extend the minmax concept into more levels, large advantage, medium advantage small advantage, and then link forward button to the largest advantage? If there are multiple moves with the same advantage then forward button should probably be disabled because there is no right way to continue.

  • lazyplayer ★ at 2021-06-05

    Maybe you can have a counter for evaluation and then when we click “black advantage” the counter is decremented, and white advantage it's incremented. Zero indicates “balance”.

  • shalev at 2021-06-05

    Tom, I would prefer keyboard shortcuts even for “delete” and “set advantage”, since I use them fairly often. Maybe something that uses a second key, like shift+D or control+D?

  • Arek Kulczycki at 2021-06-07

    Tom, another thing. Maybe I am missing something, but usually after investigating a branch I forget to set advantage on the leaves. Later I cannot set advantage to the whole branch because there are already branches inside. Is that something you could implement, to propagate the advantage to all child branches?

  • David J Bush ★ at 2021-06-07

    If you do not set the advantage on a leaf node, then the next move symbol would indicate that, would it not?

    How difficult is it to search your tree for unresolved leaves?

    If you do not remember which leaf you did not mark, look at all of them.

    If you don't remember, how do you know that you did not miss some branch with the opposite outcome?

  • Tom Ace at 2021-06-08

    I don't want to support multiple levels of advantage.  I used jhex a lot and never used the two levels that it has.

    For several reasons (including the points mentioned by David), I prefer to only allow advantage setting on leaves.

    shalev has convinced me to add a shortcut for delete and set advantage.  I'm not sure yet if it'll be ctrl- or just plain.

  • lazyplayer ★ at 2021-06-08

    Tom, so you don't want to mark internal nodes with advantage but you're willing to mark them with “preferred”? I think that you're inconsistent. :)

  • lazyplayer ★ at 2021-06-08

    Anyway, more seriously, without multi levels of advantage t some point we've to stop analysing because we can no longer remember what was closer to winning and what was not. I can live without a principled “forward” button but I can't live without knowing what is worth looking again and what is not.

  • lazyplayer ★ at 2021-06-08

    Btw, what is licensing of the code? If you are OK with it I can considering forking a new version with the multiple levels

  • lazyplayer ★ at 2021-06-08

    Another missing feature, but very hard to implement, is some sort of equivalence between positions. In hex there are often many moves that, after you look at them, you see that they're equivalent, or nearly so. You would like to link or merge the two trees but you can't because they're theoretically different moves… well, perfection is not of this world…

  • David J Bush ★ at 2021-06-08

    Lazy, if an analysis tool can recognize common patterns, that sounds the same to me as an engine, something that can figure out aspects of the game which the user did not necessarily figure out. As such, I would call that unethical.

  • lazyplayer ★ at 2021-06-09

    David, the idea would be to insert the pattern, that is, to insert the fact that two positions are equivalent. But yeah the more feature this thing has the more “computer-assisted”. Is this bad? Not necessarily. As long as we all play by the same rules there is no unfairness.

  • Arek Kulczycki at 2021-06-10

    Hmm, seems you've got it worked out then. I don't really exploit all the options the tool provides, I just click a lot very fast and later regret that things aren't marked… So conveniently I would mark the root of analysis as won/lost if I already made my mind, but if there are drawbacks to that then all good :)

  • add3993 at 2021-06-12

    Yeah lazy's suggestion seems solid.  Basically I think you're asking for, in addition to “advantage white/advantage black” labels for game-tree nodes, a collection of extra labels (A, B, C…)

    when you use label A you're marking that as similar to other things you've marked A, but otherwise agnostic to its game value.  It could refer e.g. to a local outcome on part of the board.

  • lazyplayer ★ at 2021-06-13

    add3993, yeah you can see it like that, but it would require marking internal nodes, and that was already discarded… well, it's not possible to make everyone happy with the same tool.

  • lazyplayer ★ at 2021-06-13

    The tool would also have to deal with inconsistencies, like, two nodes are marked the same, but one seems winning and the other losing. In general when you mark internal nodes you get these inconsistencies and indeed they're a problem.

  • Tom Ace at 2021-06-28

    I uploaded a new version (2.4) today.  It has the option to disable rings (hollow stones) as requested by eobllor.  It has keyboard shortcuts as requested by shalev and eobllor.  It disables selecting images as requested by Arek Kulczycki.

    The documentation (click help in the drop-down menu) has the details.

    A funny thing happened when I coded keyboard shortcuts.  They worked in every browser I tried except Firefox, which has a bug that makes keystroke events stop working in some situations.  I went to report the bug and found that someone else had already reported it, ten years ago. https://bugzilla.mozilla.org/show_bug.cgi?id=706773  I've seen browser bugs languish for a while before, but leaving a bug unfixed for ten years is impressive.  I recoded a few things to work around Firefox's bug and now it works in every browser I have on hand.

    As usual, let me know if you find any problems.

  • David J Bush ★ at 2021-07-01

    I am not well familiar with how Bugzilla works, but apparently 11 months ago it got moved to

    https://bugzilla.mozilla.org/show_bug.cgi?id=1656849

    which in turn “depends on” 706773 and three other bugs. What a mess.

  • shalev at 2021-07-03

    Thanks Tom!

    This is just a nitpick at this point, but “command + left-arrow” now goes back a move, whereas I use that shortcut to navigate back to the previous page in the browser. So if I want to quickly analyze a move from littlegolem, I would click on the minortriad link, click a few moves, then click “command + left-arrow” to return to littlegolem, but that will fail and I'd have to reach for the mouse to click the back arrow in the corner of the screen.

    Is there a way for you to bind “leftarrow” as a keyboard shortcut, but not to also steal “command + leftarrow” which is a browser shortcut? I'm using Chrome on a mac.

  • Tom Ace at 2021-07-06

    I uploaded a new release today (2.5).  It has minor bug fixes and it preserves the function of command+leftarrow.  Thanks to shalev for the request and for his help with testing.

  • Tom Ace at 2021-12-20

    I'm thinking about supporting two levels of advantage. I started with only one level because I like a simple user interface (not a lot of buttons) and I never felt a need for multiple levels when I've analyzed games myself. I recognize that some people would like more than one level but I don't know how many people would use the feature if it were there. Would you?

    My preference is to disrupt the existing look and feel as little as possible. I would like to continue using + and - in stones to indicate advantage and disadvantage. Two levels could be indicated with hollow and solid - and + symbols. It seems intuitive to me that hollow means weak and solid means strong; do you agree?

    sample

    I'd like to keep just two buttons – adv. w and adv. b – but there are several ways to have them operate, e.g.:

    1. clicking cycles through levels: the first click on an adv button sets weak; clicking again increases to strong; clicking yet again returns to neutral.
    2. click sets weak advantage, ctrl-click sets strong advantage.
    3. click sets strong advantage, ctrl-click sets weak advantage.
    4. [feel free to offer another suggestion]

    Each method has pros and cons. If weak advantage is indicated by hollow + and strong advantage by solid +, methods 1 and 2 would not preserve the existing look and feel for players who only want to set one level of advantage. You'd be seeing hollow symbols all the time instead of filled ones, which I personally would find somewhat irksome.

    Then there's the question of how keyboard shortcuts should work.

  • Tom Ace at 2021-12-20

    Sample hollow and solid symbols are at https://minortriad.com/adv.png

  • David J Bush ★ at 2021-12-20

    I'm all in favor of five possible labels (including unevaluated) for next move symbols. Thanks.

  • lazyplayer ★ at 2021-12-29

    Tom, thanks for the improvement. I do have an aesthetic complain. The white stones don't have the ring in them. They're not symmetrical with black. This greatly diminishes the beauty of everything heh. :)

  • Tom Ace at 2022-06-16

    I have a new version that supports two levels of advantage (advantage or “½ advantage” for either black or white). It's available as a beta version for testing at https://minortriad.com/ahexlgbeta.html

    The new ½ advantage feature is optional (you can disable it in the menu that comes up when you click on the ☰ icon). Files written with this beta version that contain ½ advantage positions won't be readable by earlier versions.

    Comments, suggestions, and bug reports are welcome.

Return to forum

Reply to this topic