New WinBoard alpha version
Posted: 25 Nov 2009, 14:30
I posted a new winboard.exe at http://home.hccnet.nl/h.g.muller/winboard.zip .
This version implements the -fUCI and -sUCI options in a different way than previous WinBoard versions: there now is a new WinBoard option /adapterCommand="...", where "..." gives the command-line WinBoard has to use for starting up the adapter (i.e. Polyglot). The default value for the adapterCommand is "polyglot -noini -ec %%cp -ed %%d".
This requires some explanation: Most of what you write in the adaptorCommand is use literally. You could have written "polyglot polyglot.ini", or even simply "polyglot", and it would be able to work with old-fashioned Polyglots. But if there is a % in the adapterCommand, the word after it is interpreted as the name of a WinBoard command-line option, and the value of this option is substituted for it. So if the adapterCommand is "polyglot -noini -ec %fcp", and Fruit is running as first engine, it would translate to "polyglot -noini -ec Fruit". With Polyglot versions 1.4.46b or higher, "-ec Fruit" would specify that the EngineCommand Polyglot has to use is Fruit. (So no polyglot.ini file is necessary anymore to instruct Polyglot what to do, which is what the -noini says.)
Now the adapterCommand must not only be useful for the first engine, but also for the second. So you don't know if you would have to write %fcp or %scp in it, as value of the Polyglot -ec option. To solve that, if the first character after the % is again a %, this second % is replaced by the letter f or s, as the occasion requires. So "%%cp" translates to "%fcp" when you run the first engine with -fUCI, and to %scp if you run the second engine with -sUCI. Similarly, "%%d" translates to "%fd" or "%sd" for supplying the EngineDir (-ed) to Polyglot.
Any string, int or boolean option of WinBoard can be used in the adapter command this way. So you could add "-log %debug" to make the production of a polyglot.log dependent on if WinBoard produced a debug file: it would translate to "-log true" or "-log false" depending on the setting of the WinBoard -debug option.
Currently, the adapterCommand appears in the Options->Global Settings dialog in stead of the polyglotDir. I am not sure if this is a good idea; it might be better to hide this option from the naive user, and only allow its setting through command-line options (or ini files). The /polyglotDir option still exists, btw., and specifies the folder where the polyglot.exe comamnd should be given. (i.e. where polyglot.exe is.) So evenually I will probably keep that in the Options->Global Settings dialog. Users are much more likely to change that. But for testing it was a bit more convenient to have the command itself available.
Please let me know if there are any problems with this new method!
This version implements the -fUCI and -sUCI options in a different way than previous WinBoard versions: there now is a new WinBoard option /adapterCommand="...", where "..." gives the command-line WinBoard has to use for starting up the adapter (i.e. Polyglot). The default value for the adapterCommand is "polyglot -noini -ec %%cp -ed %%d".
This requires some explanation: Most of what you write in the adaptorCommand is use literally. You could have written "polyglot polyglot.ini", or even simply "polyglot", and it would be able to work with old-fashioned Polyglots. But if there is a % in the adapterCommand, the word after it is interpreted as the name of a WinBoard command-line option, and the value of this option is substituted for it. So if the adapterCommand is "polyglot -noini -ec %fcp", and Fruit is running as first engine, it would translate to "polyglot -noini -ec Fruit". With Polyglot versions 1.4.46b or higher, "-ec Fruit" would specify that the EngineCommand Polyglot has to use is Fruit. (So no polyglot.ini file is necessary anymore to instruct Polyglot what to do, which is what the -noini says.)
Now the adapterCommand must not only be useful for the first engine, but also for the second. So you don't know if you would have to write %fcp or %scp in it, as value of the Polyglot -ec option. To solve that, if the first character after the % is again a %, this second % is replaced by the letter f or s, as the occasion requires. So "%%cp" translates to "%fcp" when you run the first engine with -fUCI, and to %scp if you run the second engine with -sUCI. Similarly, "%%d" translates to "%fd" or "%sd" for supplying the EngineDir (-ed) to Polyglot.
Any string, int or boolean option of WinBoard can be used in the adapter command this way. So you could add "-log %debug" to make the production of a polyglot.log dependent on if WinBoard produced a debug file: it would translate to "-log true" or "-log false" depending on the setting of the WinBoard -debug option.
Currently, the adapterCommand appears in the Options->Global Settings dialog in stead of the polyglotDir. I am not sure if this is a good idea; it might be better to hide this option from the naive user, and only allow its setting through command-line options (or ini files). The /polyglotDir option still exists, btw., and specifies the folder where the polyglot.exe comamnd should be given. (i.e. where polyglot.exe is.) So evenually I will probably keep that in the Options->Global Settings dialog. Users are much more likely to change that. But for testing it was a bit more convenient to have the command itself available.
Please let me know if there are any problems with this new method!