Cutechess engines.json

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Cutechess engines.json

Post 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
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cutechess engines.json

Post 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"
   },
User avatar
hgm
Posts: 27792
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Cutechess engines.json

Post 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?
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess engines.json

Post 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...
User avatar
ilari
Posts: 750
Joined: Mon Mar 27, 2006 7:45 pm
Location: Finland

Re: Cutechess engines.json

Post 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.
Adam Hair
Posts: 3226
Joined: Wed May 06, 2009 10:31 pm
Location: Fuquay-Varina, North Carolina

Re: Cutechess engines.json

Post 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.
User avatar
hgm
Posts: 27792
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Cutechess engines.json

Post 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.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Cutechess engines.json

Post 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 :) .
User avatar
Zlaire
Posts: 62
Joined: Mon Oct 03, 2011 9:40 pm

Re: Cutechess engines.json

Post 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.
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: Cutechess engines.json

Post by Richard Allbert »

I will, I'll try to have it finished by the end of the week.