kaorahi / lizgoban

Leela Zero & KataGo visualizer
GNU General Public License v3.0
172 stars 29 forks source link

Komi and rules not set from default preset #62

Closed ISibboI closed 3 years ago

ISibboI commented 3 years ago

Hi,

thanks again for your help on remote controlling lizgoban. I got lizgoban to pull in moves from OGS automatically now.

I noticed a small bug with the presets on the way. By default, the first (and in my case only) preset from the config.json is chosen. Without choosing that same prefix again from the preset menu, it ignores the komi and rules set in the preset though.

I made myself a config.json like this:

{
    "analyze_interval_centisec": 20,
    "autosave_deleted_boards": 5,
    "autosave_sec": 300,
    "sgf_dir": "~/git/lizgoban/sgf/",
    "exercise_dir": "~/git/lizgoban/exercise/",
    "max_cached_engines": 3,
    "preset": [
        {
            "label": "KataGo",
            "accelerator": "F2",
            "komi": 6.5,
            "rules": "japanese",
            "engine": ["katago", "gtp",
                       "-override-config", "analysisPVLen=50, defaultBoardSize=19",
                       "-model", "g170e-b20c256x2-s5303129600-d1228401921.bin.gz",
                       "-config", "gtp.cfg"]
        },
        {"label": "Hide hints", "accelerator": "F3", "board_type": "raw"},
        {"label": "Show hints", "accelerator": "F4", "board_type": "double_boards"}
    ]
}

And when I start lizgoban like this: npm start -- -c config.json, it uses komi 7.5 and chinese rules.

I would expect it to use komi 6.5 and japanese rules, as set in the config.

kaorahi commented 3 years ago

Hi, thx for the report. I pushed two commits for komi in preset.

FYI: You can also change komi_for_new_game and komi_for_new_handicap_game by setting komi on a fresh board (= an empty game). https://github.com/kaorahi/lizgoban/issues/54#issuecomment-640573763

ISibboI commented 3 years ago

Thanks, now it works :)