Configuring UCIPlug

UCIPlug supports configuration via a file. Configuration filename is “UCIPlug.exe.config” and has to be present in the same folder as the EXE.

It is a XML file of the following format:

<?xml version="1.0"?>
<configuration>
 
  <configSections>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
          
<section name="uciPlug.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
 
   
</sectionGroup>
 
 
</configSections>
 
 
<userSettings>
 
   
<uciPlug.Properties.Settings>

       
<setting name="EngineName" serializeAs="String">

         
<value>C:\Program Files (x86)\Arena\Engines\Rybka\Rybka v2.2n2.mp.x64.exe</value>

       
</setting>

       
<setting name="LogPath" serializeAs="String">

         
<value>C:\ProgramData</value>
 
       
</setting>
 
   
</uciPlug.Properties.Settings>
 
 
</userSettings>
 
 
<startup><supportedRuntime version="v2.0.50727"
/></startup>
</configuration>

Legend for the highlighted items: Keyname and Value

Parameters description:

  • EngineName should have the absolute path to the UCI Engine that needs to be wrapped around. This engine is loaded by UCIPlug.
  • LogPath value specifies where the protocol dump has to be saved. This value can be empty. If it is empty, ProgramData folder gets used (usually C:\ProgramData) by default.

 

Note that the default log file name is “pluglog.txt”. If a file with this name already exists, it is appended with the new dump data.


Using UCIPlug in a Chess Interface

I will use the Chess GUI Arena to explain the steps. These steps are applicable to other UCI chess interfaces too.

STEP 1: Update uciplug.exe.config with the proper UCI engine full path and log path values. For ex., the above shown CONFIG file will load Rybka 2.2n2 that comes pre-packaged with Arena.

STEP 2: Copy UCIPlug.exe along with uciplug.exe.config in to a separate folder under Arena’s “Engines” folder. If Arena is installed in its default folder, it is “C:\Program Files (x86)\Arena\Engines”. So, in our case, uciplug.exe and uciplug.exe.config are copied to C:\Program Files (x86)\Arena\Engines\UCIPlug

STEP 3: In Arena, select “Engines > Install New Engine”.

image

 

In the FileOpen dialog, browse to the folder where you copied uciplug.exe and select it.

image

 

Press YES, when Arena asks if it has to start the engine.

image

 

Arena load UCIPlug, which in turn loads Rybka (as mentioned in the config file). Arena updates its engine pane with details like shown below:

image

 

Open the pluglog.txt (in C:\ProgramData) to see what UCI messages were exchanged:

In the log below, statements that start with “-------|CMD: “ are commands issued by Arena (Chess GUI). UCI messages/responses from Rybka are marked with “RSP:

uciPlug.exe Information: 0 : PUMP: Engine C:\Program Files (x86)\Arena\Engines\Rybka\Rybka v2.2n2.mp.x64.exe started @ 4:03:22 PM
uciPlug.exe Information: 0 : PUMP: SETUP complete
--------------------------------------------------
-------|CMD: xboard
-------|CMD: uci
RSP: id name Rybka 2.2n2 mp
RSP: id author Vasik Rajlich
RSP: option name Hash type spin min 2 max 4096 default 32
RSP: option name Max CPUs type spin min 1 max 2048 default 2048
RSP: option name Display Draw Scores type check default false
RSP: option name Engine Priority type combo default NormalAndLow var Normal var NormalAndLow var Low
RSP: option name Display PV Tips type check default false
RSP: option name CPU Usage type spin min 1 max 100 default 100
RSP: option name Win Percentage to Hash Usage type check default false
RSP: option name Display Current Move type check default true
RSP: option name Compensate Lost Time type check default true
RSP: option name NalimovPath type string default <empty>
RSP: option name NalimovCache type spin min 1 max 256 default 1
RSP: option name NalimovUsage type combo default Never var Frequently var Normally var Rarely var Never
RSP: option name Preserve Analysis type check default false
RSP: option name Clear Hash type button
RSP: option name Ponder type check default true
RSP: option name MultiPV type spin default 1 min 1 max 100
RSP: option name UCI_ShowRefutations type check default false
RSP: option name UCI_LimitStrength type check default false
RSP: option name UCI_Elo type spin default 1200 min 1200 max 2400
RSP: option name Server Buffer type check default false
RSP: option name UCI_AnalyseMode type check default false
RSP: option name UCI_Opponent type string default <empty>
RSP: option name UCI_EngineAbout type string default www.rybkachess.com
RSP: option name Outlook type combo default Neutral var Very Pessimistic var Slightly Pessimistic var Neutral var Slightly Optimistic var Very Optimistic var Ultra Optimistic
RSP: option name Rate Of Play type combo default Normal var Ultraslow var Slow var Normal var Fast var Ultrafast
RSP: option name Time Usage type combo default Varied var Constant var Varied
RSP: option name Emergency Time Buffer type combo default Medium var Small var Medium var Large
RSP: uciok
-------|CMD: setoption name Hash value 128
-------|CMD: setoption name Max CPUs value 2048
-------|CMD: setoption name Display Draw Scores value false
-------|CMD: setoption name Engine Priority value NormalAndLow
-------|CMD: setoption name Display PV Tips value false
-------|CMD: setoption name CPU Usage value 100
-------|CMD: setoption name Win Percentage to Hash Usage value false
-------|CMD: setoption name Display Current Move value true
-------|CMD: setoption name Compensate Lost Time value true
-------|CMD: setoption name NalimovPath value C:\TB
-------|CMD: setoption name NalimovCache value 32
-------|CMD: setoption name NalimovUsage value Never
-------|CMD: setoption name Preserve Analysis value false
-------|CMD: setoption name Ponder value true
-------|CMD: setoption name MultiPV value 1
-------|CMD: setoption name UCI_ShowRefutations value false
-------|CMD: setoption name UCI_LimitStrength value false
-------|CMD: setoption name UCI_Elo value 1200
-------|CMD: setoption name Server Buffer value false
-------|CMD: setoption name UCI_AnalyseMode value false
-------|CMD: setoption name UCI_Opponent value <empty>
-------|CMD: setoption name UCI_EngineAbout value www.rybkachess.com
-------|CMD: setoption name Outlook value Neutral
-------|CMD: setoption name Rate Of Play value Normal
-------|CMD: setoption name Time Usage value Varied
-------|CMD: setoption name Emergency Time Buffer value Medium
-------|CMD: isready
RSP: info setting display draw scores to false
RSP: info setting engine priority to normal
RSP: info setting display pv tips to false
RSP: info setting win percentage to hash usage to false
RSP: info setting display current move to true
RSP: info lost time compensation set to true
RSP: info setting nalimov usage to never
RSP: info setting preserve analysis to false
RSP: info displaying 1 variations
RSP: info UCI_ShowRefutations set to false
RSP: info UCI_LimitStrength set to false
RSP: info UCI_Elo set to 1200
RSP: info Server Buffer set to false
RSP: info UCI_AnalyseMode set to false
RSP: info UCI_Opponent set to <empty>
RSP: info setting outlook to neutral
RSP: info setting rate of play to normal
RSP: info setting time usage style to varied
RSP: info setting emergency time buffer to medium
RSP: readyok
-------|CMD: quit
PUMP: Hit a quit in the stream. Quitting!

You can use UCIPlug just like any other UCI engine in Arena. Try starting an Engine tournament, for ex, between UCIPlug and a weak engine to see how Rybka thinks and talks to the UI.

Last edited Jan 4, 2011 at 9:45 AM by kannanmr, version 3

Comments

No comments yet.