popojan / goban

3D igo/baduk/weiqi/go game board and GUI for GnuGo and other GTP engines ray traced by GLSL shader
https://hraj.si/goban
GNU General Public License v3.0
47 stars 3 forks source link

Feature request: Show gtp infomation on the interface #21

Closed lj739 closed 4 years ago

lj739 commented 4 years ago

To the author: I use a tail program to show katago's gtp infomation, then I can evaluate the move just played. The interface of goban is so nice that let the tail program laying on it seems to be a very annoying thing. Just see you are working on a analying function, can't wait to test it. :)

popojan commented 4 years ago

Hi, sorry to say that, I am not working on an analysis function yet. I just collected all the ideas on possible enhancements and was considering making a poll to prioritize them. However since you seem to be the only one giving feedback, you get the priority.

Moreover, your request is in line with an idea Engine console, displayed on the board. If this is done correctly, we could also get rid of the black background window.

popojan commented 4 years ago

Would you tell me please, what exactly in the KataGo GTP output do you look at to evaluate your move? Could not such information be optionally displayed, e.g., already when you hover over intersection when planning your move? I'd prefer not showing analysis information for all points at once when in ordinary playing mode.

GTP console is sure thing to be added, I am just thinking about a way to display such information right on the board.

lj739 commented 4 years ago

I'm not very sure whether those information can be optionally displayed, but I just need those information marked by red lines. I don't use goban to plan my move,  those information can tell me the move  played is good or not. If it's a bad move, I take back this move and try another until the winrate doesn't drop down much. Analysis function is not essential because other program can do this very well already. Goban's most crucial advantage is the beautiful gui, it should be made fitable for playing and teaching, don't make it like other programs which has all the functions for research. I've tested katrain for days, it's teaching function is very useful, you can take a look at it.

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月25日(星期一) 晚上11:37 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

Would you tell me please, what exactly in the KataGo GTP output do you look at to evaluate your move? Could not such information be optionally displayed, e.g., already when you hover over intersection when planning your move? I'd prefer not showing analysis information for all points at once when in ordinary playing mode.

GTP console is sure thing to be added, I am just thinking about a way to display such information right on the board.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

lj739 commented 4 years ago

Where will you place the gtp console on the board? If the console take up too much place of the board, it would destroy the gui. The image I just posted have several lines. showing the marked information of the first line only or showing entire first line on the bottom of gui may be a good idea.

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月25日(星期一) 晚上11:37 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

Would you tell me please, what exactly in the KataGo GTP output do you look at to evaluate your move? Could not such information be optionally displayed, e.g., already when you hover over intersection when planning your move? I'd prefer not showing analysis information for all points at once when in ordinary playing mode.

GTP console is sure thing to be added, I am just thinking about a way to display such information right on the board.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

popojan commented 4 years ago

I am afraid I don't see any image attached, please add it later to your post.

Nevertheless, good thing is the whole GUI overlay is customizable by editing html/css like code, at the moment in data/gui/goban.{rml,rcss}. So the main task is to extract stderr logs from katago (current goban redirects them to /dev/null) and choose appropriate lines for display. I will try to code this in a more general way. Shared message area at the bottom is a good candidate for placement of such information.

lj739 commented 4 years ago

20200526081309

popojan commented 4 years ago

Thank you! I guess I figured it out. Don't you mind waiting till computer moves and displays such info?

There is a proof of concept build with basic functionality. You set up regular expressions to match parts of an engine standard error output, and these are then displayed in the status area. I can guide you to tweak the regular expressions.

lj739 commented 4 years ago

Human player must wait computer moves then get such display info, if you get this info in advance, playing with katago is meaningless. This info must have a option to hide, so when you don't want to see this info and want to play against katago with your own wisdom, you can just click a button or something else to hide it. On the image above, w means win rate, the second means how many stones your opponent is in the lead.

lj739 commented 4 years ago

There is no status area on goban gui. Do you mean the separated black window? I'm not familiar with code language, but I can have a try if you give some instructions.

popojan commented 4 years ago

Well, let us wait till tomorrow I will polish it a bit more. No, not the separated black window, I mean the area near bottom border of goban screen. Usually empty, except pass moves, resignation and similar info.

If you have a look inside data/config.json you see katago section with an array called messages:

"messages": [
    "Controller:( )",
    ":.*(T.*)"
]

Each line in quotes is a regular expression, pattern that is matched against katago standard error output. If you delete these no info is displayed at all: "messages": []. If there is any pattern and matching line in katago output, the GUI will display the matched part of the line captured between parentheses (). There are characters with special meaning, e.g. . stands for arbitrary character, * means repetition zero or more times, ^ stands for the very beginning of line. It is powerful and well documented.

We can start simple by:

"messages": [
    "^:.*(T.*)"
]

which should display the line right above ---White(^)--- in katago output. The numbers slightly differ from the first line below, if you need that one I will have to tweak the logic a bit :-)

Then I added another pattern Controller:( ) matching empty space. Such lines appear in katago output when human moves (issues gtp commands). That should be responsible for hiding previous evaluation when player performs next move.

You are welcome to play with this feature and become familiar with that language, or you can wait until I tweak the patterns for katago 1.4.2. Moreover the engine needs to be also set up in the json: path to the executable, parameters, name for display etc., and finally "enabled": 1. I hope the attributes are self-explanatory.

The goal of my effort is to make goban highly customizable, inviting modders when it is ready :)

lj739 commented 4 years ago

There is  no config.json in data dir. Is it the new feature you just added? I see a new image on your GitHub page, maybe in the new version there is a config.json.

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月26日(星期二) 上午9:09 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

Well, let us wait till tomorrow I will polish it a bit more. No, not the separated black window, I mean the area near bottom border of goban screen. Usually empty, except pass moves, resignation and similar info.

If you have a look inside data/config.json you see katago section with an array called messages: "messages": [ "Controller:( )", ":.(T.)" ]
Each line in quotes is a regular expression, pattern that is matched against katago standard error output. If you delete these no info is displayed at all: "messages": []. If there is any pattern and matching line in katago output, the GUI will display the matched part of the line captured between parentheses (). There are characters with special meaning, e.g. . stands for arbitrary character, * means repetition zero or more times, ^ stands for the very beginning of line. It is powerful and well documented.

We can start simple by: "messages": [ "^:.(T.)" ]
which should display the line right above ---White(^)--- in katago output. The numbers slightly differ from the first line below, if you need that one I will have to tweak the logic a bit :-)

Then I added another pattern Controller:( ) matching empty space. Such lines appear in katago output when human moves (issues gtp commands). That should be responsible for hiding previous evaluation when player performs next move.

You are welcome to play with this feature and become familiar with that language, or you can wait until I tweak the patterns for katago 1.4.2. Moreover the engine needs to be also set up in the json: path to the executable, parameters, name for display etc., and finally "enabled": 1. I hope the attributes are self-explanatory.

The goal of my effort is to make goban highly customizable, inviting modders when it is ready :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

popojan commented 4 years ago

Yep, in the new one. Should appear also on the website after refresh.

lj739 commented 4 years ago

I've had a test of the new feature, katago gtp info shown at the bottom, but what it shown is the last line of the info. The first line is the primary info human player needs.

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月26日(星期二) 上午9:09 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

Well, let us wait till tomorrow I will polish it a bit more. No, not the separated black window, I mean the area near bottom border of goban screen. Usually empty, except pass moves, resignation and similar info.

If you have a look inside data/config.json you see katago section with an array called messages: "messages": [ "Controller:( )", ":.(T.)" ]
Each line in quotes is a regular expression, pattern that is matched against katago standard error output. If you delete these no info is displayed at all: "messages": []. If there is any pattern and matching line in katago output, the GUI will display the matched part of the line captured between parentheses (). There are characters with special meaning, e.g. . stands for arbitrary character, * means repetition zero or more times, ^ stands for the very beginning of line. It is powerful and well documented.

We can start simple by: "messages": [ "^:.(T.)" ]
which should display the line right above ---White(^)--- in katago output. The numbers slightly differ from the first line below, if you need that one I will have to tweak the logic a bit :-)

Then I added another pattern Controller:( ) matching empty space. Such lines appear in katago output when human moves (issues gtp commands). That should be responsible for hiding previous evaluation when player performs next move.

You are welcome to play with this feature and become familiar with that language, or you can wait until I tweak the patterns for katago 1.4.2. Moreover the engine needs to be also set up in the json: path to the executable, parameters, name for display etc., and finally "enabled": 1. I hope the attributes are self-explanatory.

The goal of my effort is to make goban highly customizable, inviting modders when it is ready :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

添加到短语集

没有此单词集: -> 中文(简体)...

创建新的单词集...

拷贝

popojan commented 4 years ago

Yes I know, sorry, I screwed the regular expression when packing the files. Please add ^ at the beginning of the pattern, as shown in the above lenghty post.

popojan commented 4 years ago

Please try this patch as a hotfix for your usecase. I will take my time and work more systematically from now on :-)

lj739 commented 4 years ago

This patch doesn't work. None shown at the bottom of goban.  Pachi must be deleted, or the undo function becomes very slow.

Please try this patch as a hotfix for your usecase. I will take my time and work more systematically from now on :-)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

popojan commented 4 years ago

It is a pity. Here it worked, matching the bold part of the highlighted line:

Tree: : T 11.94c W 11.71c S 0.23c ( +1.3 L +0.8) N 505 -- Q4 Q16 D16 D4 R6 C17 C1 ---White(^)--- Q4 : T 12.10c W 11.86c S 0.24c ....

Do you have such in your KataGo output?

Good point with the undo. Setting "enabled": 0 for pachi should suffice.

lj739 commented 4 years ago

I use large komi, below is a example

Tree: : T -100.39c W -95.33c S  -5.06c (-19.0 L -14.8) N      45  --  E11 C9 C7 B11 ---White(^)--- E11 : T -100.35c W -95.29c S  -5.06c (-19.0 L -14.8) LCB -102.32c P 25.03% WF  6.67% PSV      12 N      12  --  E11 C9 C7 B11 O17 : T -100.20c W -95.12c S  -5.08c (-19.0 L -14.7) LCB -103.46c P 10.87% WF  6.69% PSV       5 N       7  --  O17 R14 E11 C9 C6 F3  : T -100.46c W -95.37c S  -5.09c (-19.0 L -14.8) LCB -280.00c P  5.22% WF  6.66% PSV       2 N       2  --  F3 C9 R14 : T -99.94c W -95.10c S  -4.85c (-18.7 L -14.7) LCB -280.00c P  4.31% WF  6.70% PSV       2 N       2  --  R14 O17 R17 : T -100.55c W -95.19c S  -5.36c (-19.4 L -15.4) LCB -280.00c P  2.56% WF  6.66% PSV       1 N       2  --  R17 Q17 O3  : T -100.76c W -95.49c S  -5.27c (-19.2 L -14.9) LCB -280.00c P  2.04% WF  6.64% PSV       1 N       2  --  O3 C3 F4  : T -99.88c W -95.10c S  -4.78c (-18.7 L -14.6) LCB -280.00c P  1.98% WF  6.71% PSV       1 N       2  --  F4 B5 D6  : T -100.55c W -95.57c S  -4.98c (-18.9 L -14.9) LCB -280.00c P  1.71% WF  6.66% PSV       0 N       2  --  D6 F11 H16 : T -100.53c W -95.56c S  -4.97c (-18.9 L -15.0) LCB -280.00c P  1.64% WF  6.66% PSV       0 N       2  --  H16 F11 F11 : T -100.44c W -95.40c S  -5.03c (-19.0 L -14.9) LCB -280.00c P  1.57% WF  6.67% PSV       0 N       2  --  F11 B15

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月26日(星期二) 下午4:44 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

It is a pity. Here it worked, matching the bold part of the highlighted line:

Tree: : T 11.94c W 11.71c S 0.23c ( +1.3 L +0.8) N 505 -- Q4 Q16 D16 D4 R6 C17 C1 ---White(^)--- Q4 : T 12.10c W 11.86c S 0.24c ....

Do you have such in your KataGo output?

Good point with the undo. Setting "enabled": 0 for pachi should suffice.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

popojan commented 4 years ago

uh, less whitespace \\s than expected let's change one + to *

from ^:\\s+T\\s+[^\\s]+\\s+(.\\s+[^\\s]+).*\\(\\s+([^\\s]+\\s+.) to ^:\\s+T\\s+[^\\s]+\\s+(.\\s+[^\\s]+).*\\(\\s*([^\\s]+\\s+.)

lj739 commented 4 years ago

Done. The first line is weighted win rate data, if the second line(the primary move) can be shown, it will be perfect.

------------------ 原始邮件 ------------------ 发件人: "Jan Popelka"<notifications@github.com>; 发送时间: 2020年5月26日(星期二) 下午5:14 收件人: "popojan/goban"<goban@noreply.github.com>; 抄送: "费而隐"<909417887@qq.com>;"Author"<author@noreply.github.com>; 主题: Re: [popojan/goban] Feature request: Show gtp infomation on the interface (#21)

uh, less whitespace \s than expected let's change one + to *

from ^:\s+T\s+[^\s]+\s+(.\s+[^\s]+).\(\s+([^\s]+\s+.) to ^:\s+T\s+[^\s]+\s+(.\s+[^\s]+).\(\s*([^\s]+\s+.)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

popojan commented 4 years ago

Fine. Next release will come with regex error checking and logic to display primary move info. For watching bot matches it is better to delete Controller:( ) pattern, so that the evaluation info does not disappear that fast.

popojan commented 4 years ago

Released. Displays primary move. Thanks for the idea.