Michel wrote:Actually I have a more general idea.
Why not add commands showoptions and setoption to the WB protocol. After "showoptions" the engine would respond with a list of its runtime settable options in UCI styleoption <name> type <type> [default <default>] [max <max>] [min <min>] [var <var>]
These can be presented to the user in a dialog box.
If the user changes an option it can be send to the engine in UCI stylesetoption name <name> value <value>
Michel
Some time ago we did discuss this possibility in another thread. The discussion did not come to a full conclusion yet. Considering what has been said there, my current preference is to use the WB feature command to send the option to the GUI as a text string, as
feature option="text string"
where the only thing special compared to other features woud be that this feature can be sent multiple times and will then all be remembered (in stead of just the one that was sent last. This way of doing it does not break compatibility with older GUIs; they would simply reject the feature.
The text string describing the option would then define the name of the option, the type (supporting all UCI types, e.g. check, spin), and additional information depending on the type. The UCI syntax seems too silly to use, though. Why require keywords to specify a name or type is following, if a name and type have to be lways present? The order in which they come can identify them more efficiently. And if keywords would be needed, I think it would be better if they were recognizable, e.g. by all starting with '-'. That philosophy would result in a syntax
"name -type additional info"
where '-type' would be one of '-check', '-spin', '-combo' etc. Calling them 'type spin', 'type combo' etc. as UCI does just seems redundant: you need a reserved word anyway (type), so you might as well reserve spin and combo directly. The leading '-' plus the fact that there are only 5 types makes the type easy to recognize by the parser, and everything before it can automatically be identified as option name (in case it contans spaces).
As for the 'additional info': I was told that for type spin in UCI the min, max and default parameters are mandatory. That makes the min, max and default keywords totally redundant in this option. What could follow is simply 3 numbers. Similarly, type check needs only a default, and could be followed by a single number 0 or 1. For type string everything that follows (except the frirst space) can be nothing else but default value. Type button does not seem to need additional information at all (unless I misunderstand what it does). Only for type combo there seems an issue: this has a variable number of text arguments, which could be space-containing. So the text that follows has to be parsed into individual values. This coud be done by preceding each of them with 'var', as UCI does, but it would seem much more natural to me to separate them with a single reserved character unlikely to occur in the arguments. But I guess there is something to be said for a multi-character separator, as it reduces the likelihood you would want this separater to occur as (part of an) argument. Using 'var' as separator seems a very bad choice; '-var' would already give a much better readability, but IMO '///' would be much clearer.
So you would get
feature option="EGTB cache size -spin 0 8 4"
feature option="style -combo patzer /// very good /// world champion -default very good"
feature option="book -string C:\books\big.bin"
feature option="resign -check 1"
feature option="clear hash now -button"
WinBoard would then use these options (when the user triggered this from a menu) by sending:
option EGTB cache size 6
option style world champion
option book .\book.dat
option resign 0
option clear hash now
The only thing I have doubts about is the -default in the -combo control. It seems stupid (and a source of error) to have to repeat a value that was already given in the list before. IMO it would be better to somehow mark the default value, e.g. by preceding it with an asterisk:
feature option="style -combo patzer /// *very good /// world champion"