Skip to content

Latest commit

 

History

History
107 lines (74 loc) · 4.36 KB

3B4-windows-optional-edit-gtp2ogs-js-file.md

File metadata and controls

107 lines (74 loc) · 4.36 KB

HOME

0) COMMON : INTRODUCTION

1) COMMON : MESSAGE OGS MODERATORS

2) COMMON : GENERATE THE APIKEY

3A) FOR LINUX

3B) FOR WINDOWS

3B4) Optional : Modify the gtp2ogs.js file (for example force komi to 7.5)

(You can skip this step if you dont want it)


!!! IMPORTANT !!

NOTE : This method is now outdated, you can now add the --komi argument directly, but it shows an example of how to edit gtp2ogs.js for various other reasons

NOTE 2 : A more interesting example is for your bot to send the winrate on OGS at every move, in ingame chat, as you can see below

phoenixgo-text-winrate

big big thanks to roy7 for the help !, these changes are a modification of /roy7/gtp2ogs/live

see that branch


for the outdated example :

There are many reasons why you may want to modify the gtp2ogs.js file

For example, my ai PhoenixGo cannot play if the komi is set to a value different from 7.5, it will say “unacceptable komi” and will refuse to play.

Another example is my ai PhoenixGo did not understand the command “showboard” so it could not play with gtp2ogs even though it worked correctly on sabaki

So for other reasons it may be good to know how to modify the gtp2ogs.js file

You can view a copy of gtp2ogs.js devel branch file here

i also recommend to download the amazing text editor Notepad++, which we will use in this tutorial

notepad++ will be useful to edit gtp2ogs.js, but also to manage logfiles of your ai much more easily (find all apikeys in document to remove them, autojump line, share game log files to other players, etc..), here

Right click, edit with notepad++, then search for the word “komi”, and modify the line as shown in the screenshots below :

this.command("komi " + state.komi);

To :

this.command("komi " + 7.5);

Then save and exit.

Important : dont do this if you ai supports different komi values !! It will make gtp2ogs lie to the ai by telling it the komi is always 7.5 even if it is not true. I had no choice to do it or my engine could not play other very widespread values like 6.5. This is not a problem for unranked games, but dont use this feature in ranked games !

node18 node20 node21 node22

Next Page ->