Cutechess engines.json

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Richard Allbert
Posts: 767
Joined: Wed Jul 19, 2006 7:58 am

Cutechess engines.json

Post by Richard Allbert » Sat Jul 21, 2012 11:54 am

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: 4079
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Cutechess engines.json

Post by Ferdy » Sun Jul 22, 2012 12:13 am

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: 23630
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Cutechess engines.json

Post by hgm » Sun Jul 22, 2012 7:49 am

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 5:45 pm
Location: Finland
Contact:

Re: Cutechess engines.json

Post by ilari » Sun Jul 22, 2012 9:48 am

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 5:45 pm
Location: Finland
Contact:

Re: Cutechess engines.json

Post by ilari » Sun Jul 22, 2012 9:55 am

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: 3201
Joined: Wed May 06, 2009 8:31 pm
Location: Fuquay-Varina, North Carolina

Re: Cutechess engines.json

Post by Adam Hair » Sun Jul 22, 2012 12:22 pm

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: 23630
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Cutechess engines.json

Post by hgm » Sun Jul 22, 2012 12:23 pm

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: 4079
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Cutechess engines.json

Post by Ferdy » Mon Jul 23, 2012 3:53 am

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 7:40 pm

Re: Cutechess engines.json

Post by Zlaire » Mon Jul 23, 2012 9:40 am

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: 767
Joined: Wed Jul 19, 2006 7:58 am

Re: Cutechess engines.json

Post by Richard Allbert » Mon Jul 23, 2012 9:45 am

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

Post Reply