We are currently brain-storming about how to handle engine options in the WinBoard package. Currently they can only be handled for UCI engines, by the cumbersome method of making polyglot.ini files, perhaps with the aid of an external utility. I would like to have this discussion here in public.
One necessary ingredient is to have a standard way of engines announcing the options they need or accept, like UCI engines already do. This requires an extension of WB protocol, which in itself can be easily made.
The main problem is how to use it. As an experiment I have added a menu popup in XBoard, which displays all options the engine defined. The user then can enter new values, and they are set on the engine. For some types of options it is convenient to be able to change them interactively from the menu, (e.g. playing style), mainly in human-engine play.
For options with a more permanent character (for customizing the engine to a fixed personal taste), it is almost useless, as the settings disappear when you exit XBoard. There is currently no way to specify such options through the XBoard command line: unlike the standard options, the engine-defined options are different for all engines. WinBoard does not keep a database of engines where it remembersa large number of settings for each engine. (There is a primitive list for the benefit of the start-up dialog, though.)
A much more logical place to do this would be in the PSWBTM engine manager. There it could be really useful. What I imagine is this:
The PSWBTM engine-manager dialog gets an extra button, "Configure Engine". When pressed, PSWBTM starts up the engine directly (without using WinBoard as an intermediary), and interrogates it for options. It does this by sending it an uci or xboard + protover command, to figure out if it is UCI or WB, and records the option or feature commands the engine replies with. It then creates a popup dialog where the user can alter the engine settings through suitable control elements, like spins, combo boxes, etc.
PSWBTM then maintains, as part of its engine database, for each engine the value of the WinBoard InitString, which by default is "new\nrandom\n". For any option that the user has altered compared to the default setting, PSWBTM prefixes this default InitString by "option NAME VALUE\n". The corresponding value of the InitString would then be passed to WinBoard as value for the -firstInitString or -secondInitString option (as appropriate) whenever PSWBTM invokes WinBoard with that engine.
If the engine turns out to be UCI, PSWBTM would automatically replace it with polyglot. (For this it would not only need the path to the WinBoard executable, but also to Polyglot, to be entered in its own configuration menu.) Under Windows it would use a polyglot.ini file in the engine directory as argument to polyglot (and create a dummy one there if it did not exist). This would basically be used only for communicating the engine command to Polyglot; everything else in it would be overruled by the option commands WB will send to Polyglot at the beginning of every game, as specified in the PSWBTM engine database.
What do you think of this scheme?
WinBoard itself would not really have to know anything about the option features; PSWBTM would essentially bypass it by hiding them in the InitString. (It might confuse the engine, though, if WinBoard first sends rejected option, and then send option commands anyway, so it is probably better to use a WinBoard that does know the option feature and accepts it.) An alternative would be to equip WinBoard with command-line options -firstOptions and -secondOptions which could contain (as a text string) a list of options to be send at startup, so that future WinBoard versions, that do have a menu to set engine options, could be aware of the fact that engine default settings have been overruled, by scanning the option strings and extracting the values to display them as current settings. Then interactive users could have the best of both worlds, launching the engine from the PSWBTM engine manager to get their customized option settings at start-up, and changing volatile options through the WB menu during the session.