Page 1 of 2

Cutechess engines.json

Posted: Sat Jul 21, 2012 1:54 pm
by Richard Allbert
Hi,

A while ago I wrote a simple GUI for myself which generates the batch files for running cutechess tournaments.

Today I want to use some spare time to add some more features - specifically to be able to edit the engines.json from the GUI - and had a question about how it's implemented in Cutechess, which will determine how lazy I can be with the json parser :).

So, are the json items limited to command, name, options, protocol, workingdirectory ? or can all other cutechess engine options be added in also?

Many thanks

Richard

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 2:13 am
by Ferdy
Richard Allbert wrote:Hi,

A while ago I wrote a simple GUI for myself which generates the batch files for running cutechess tournaments.

Today I want to use some spare time to add some more features - specifically to be able to edit the engines.json from the GUI - and had a question about how it's implemented in Cutechess, which will determine how lazy I can be with the json parser :).

So, are the json items limited to command, name, options, protocol, workingdirectory ? or can all other cutechess engine options be added in also?

Many thanks

Richard
In addition I use initStrings and restart.

Code: Select all

{ 
      "command" : "Deuterium-1062.exe", 
      "name" : "Deuterium-1062",
      "restart" : "on",
      "initStrings" : [ 
          "setvalue ComboAttackFactorOp 230",
          "setvalue ComboAttackFactorEn 130"
      ],
      "protocol" : "xboard",
      "workingDirectory" : "C:\\MyFiles\\Chess\\engines\\nobook\\Deuterium"
   },

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 9:49 am
by hgm
Why do you use a 'setvalue' commands rather than the compliant 'option' command from WB protocol? Are those options you don't want the user to set or know about?

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 11:48 am
by ilari
Richard Allbert wrote:So, are the json items limited to command, name, options, protocol, workingdirectory ? or can all other cutechess engine options be added in also?

Many thanks

Richard
In addition to what you just listed, "initStrings" (commands sent to the engine at startup), "whitepov" (scores from white's perspective), "restart" (restart engine after each game) and "variants" (a list of supported chess variants) are supported. Here's an example:

Code: Select all

[
	{
		"command" : "engine",
		"name" : "My Engine",
		"protocol" : "xboard",
		"restart" : "on",
		"initStrings" : [
			"first command",
			"second command"
		],
		"variants" : [
			"standard",
			"fischerandom",
			"atomic",
			"crazyhouse",
			"losers"
		],
		"whitepov" : true,
		"workingDirectory" : ""
	}
]
We also have a manual page for editing the engines.json file, but it's already outdated. I guess I should fix that...

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 11:55 am
by ilari
hgm wrote:Why do you use a 'setvalue' commands rather than the compliant 'option' command from WB protocol? Are those options you don't want the user to set or know about?
Cute Chess doesn't yet support custom Winboard options, only the hardcoded ones like "memory" and "cores". Of course the user could still set those options with init strings, but my guess is that Ferdinand has used CLOP + cutechess-cli to optimize some weights in his engine, and didn't want or need to make them user-configurable.

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 2:22 pm
by Adam Hair
Ferdy wrote:
Richard Allbert wrote:Hi,

A while ago I wrote a simple GUI for myself which generates the batch files for running cutechess tournaments.

Today I want to use some spare time to add some more features - specifically to be able to edit the engines.json from the GUI - and had a question about how it's implemented in Cutechess, which will determine how lazy I can be with the json parser :).

So, are the json items limited to command, name, options, protocol, workingdirectory ? or can all other cutechess engine options be added in also?

Many thanks

Richard
In addition I use initStrings and restart.

Code: Select all

{ 
      "command" : "Deuterium-1062.exe", 
      "name" : "Deuterium-1062",
      "restart" : "on",
      "initStrings" : [ 
          "setvalue ComboAttackFactorOp 230",
          "setvalue ComboAttackFactorEn 130"
      ],
      "protocol" : "xboard",
      "workingDirectory" : "C:\\MyFiles\\Chess\\engines\\nobook\\Deuterium"
   },
Thank you for posting this, Ferdinand. I was having trouble figuring out how to send the value for certain options to Gaviota. Now I have it working.

Re: Cutechess engines.json

Posted: Sun Jul 22, 2012 2:23 pm
by hgm
ilari wrote:Of course the user could still set those options with init strings,
That is what I meant. And your guess as to why sounds reasonable. Although engines like Fruit and Glaurung seem to make such tuning options availble to everyone.

Re: Cutechess engines.json

Posted: Mon Jul 23, 2012 5:53 am
by Ferdy
ilari wrote:
hgm wrote:Why do you use a 'setvalue' commands rather than the compliant 'option' command from WB protocol? Are those options you don't want the user to set or know about?
Cute Chess doesn't yet support custom Winboard options, only the hardcoded ones like "memory" and "cores". Of course the user could still set those options with init strings, but my guess is that Ferdinand has used CLOP + cutechess-cli to optimize some weights in his engine, and didn't want or need to make them user-configurable.
Yes that is primarily for clop and cutechess :) .

Re: Cutechess engines.json

Posted: Mon Jul 23, 2012 11:40 am
by Zlaire
Richard Allbert wrote:Hi,

A while ago I wrote a simple GUI for myself which generates the batch files for running cutechess tournaments.
If you feel like sharing this I'd be very grateful. Been thinking about doing this myself but never got around to it.

Re: Cutechess engines.json

Posted: Mon Jul 23, 2012 11:45 am
by Richard Allbert
I will, I'll try to have it finished by the end of the week.