Conducting Engine Tournaments Under Various GUIs

Though the majority of people who view this blog know how to set up a tournament in at least one GUI, I think beginners would find a step-by-step description of how to load engines and create a tournament for various GUIs to be helpful. This guide will not cover every detail for every GUI, but it should provide enough information to get a beginner started on conducting engine versus engine matches.

You can find a short review for every GUI discussed in this "how to" under the Graphical User Interfaces For Computer Chess at this blog.

First things first. You will need to download at least one chess engine, which is the code that actually plays chess. You will also need a chess GUI, which is the code that has a chess board, a clock, and handles communication between the participants. A chess program is generally the combination of the two parts. In the past, authors wrote chess programs. With the advent of common engine communication protocols and GUIs that understood these protocols, many authors switched all of their efforts to writing chess engines. Though there are some chess programs that are still actively developed (Arasan by Jon Dart comes to mind), in most cases chess engines require a commonly available GUI in order to play chess (not counting text-based console mode that nobody uses now days). Even engines that come with their own GUI can be played in other GUIs, with the notable exception of Fritz.

You can find links to download engines at some of the sites listed at the right of this blog (WBEC, Computer Chess Wiki, RWBC, Jim Ablett). These are well-respected sites and can be trusted. I recommend that you stay very organized with the engines. Place the engine folders in a dedicated folder. Adequately label each engine folder. Also, some authors make no attempt to clearly name the engine .exe files. I recommend that you edit the names so that it is clear what engine and version each .exe is.

Here are some things you should know about chess engines. Most modern engines are either Winboard-compliant engines or are UCI engines, though some engines are both. Winboard and UCI describe the way an engine and a GUI. You will need to know what type each engine is. This information should be available in a readme file that comes with the engine or the site you download the engine from will state what type it is. If you do not know what type it is, here is a simple process to find out. Double click on the engine .exe file. For most engines, this will bring up a DOS window. This means the engine is in console mode. Type in 'uci'. You may see something like the following:

You will see id name (engine name), id author (engine author), and a list of options if the engine is UCI-protocol. If the engine is not UCI, then the engine will probably tell you that you have made an illegal move (it was expecting something like 'e2e4'). This would be a Winboard engine.

You may notice that there is a .ini, .rc, .eng, or some other type of text file in the engine folder of a Winboard engine. The contents and formats will vary from engine to engine, but most Winboard engines have a text file that contains the values to different parameters, such as hash (amount of memory devoted to storing move information during a game), ponder (whether an engine thinks during its opponents time or not), CPUs (number of processors used by the engine), etc ... . For UCI engines, these type of parameters would be accessed via the GUI.

You should decide ahead of time on the common parameters and conditions assigned to all engines. How many CPUs will each engine have available (also called Cores or Threads)? How much hash (memory) will be allocated to each engine to store move information? What time control will the engines operate under? Will the engines be allowed to ponder (think; the option is also known as permanent brain) during the opponent's turn? These decisions are based on your computer resources and on what you want to test. In my case, I allow each engine one CPU, 128 MB of hash (approximately; engines may actually use more or less than this amount), and I use ponder off. My time control is 40 moves in 3 minutes (repeating), which is equivalent to the 40 moves in 4 minutes (repeating) for the CCRL's base computer. By conducting my matches in this manner, I maximize the amount of games I can accumulate for the CCRL 40/4 ratings list. Some people criticize using ponder off, saying that it is unnatural for opponents not to think during the other side's turn. And indeed, during a competition ponder is on. Yet, ponder on does not equate to twice the amount of thinking time (due to ponder misses, computer resources are being used to calculate moves that may not be played), while ponder off allows twice as many games to be played. Do what you believe is best. The same goes for the time control. Long, short, repeating, Fisher (incremental). Choose what you want to use. The only limitations is your time and your resources.

You may want to take the time to down load endgame tablebases and bitbases. Tablebases contain precalculated, optimal move information for chess endgames. Bitbases, like tablebases, inform an engine whether a position is won, lost, or drawn, but it lacks the information concerning how far away checkmate is. Many engines make use this type of data to correctly play endgames. Also, most GUIs can use endgame tablebases to adjudicate games.

Both types come in 3-men up to 6men configurations. 3-men means the only pieces on the board are both kings and one piece (either White or Black). If the piece was a bishop, then this sort of configuration is labelled KBK. If one side had a bishop and a pawn, while the other side had a knight, then the label would be KBPKN. Given the combinatoric nature of these configurations, there are only 5 3-men files, but 30 4-men files, 110 5-men files, and 365 6-men files. In addition, given the more numerous possibilities of piece placement, complete 3-men bases could be 62 kB in size; 3-men and 4-men together are about 30MB; 3 through 5-men use 7.1 GB of space; 3 through 6-men would be 1.2 terabytes in size (All of these sizes are for Nalimov EGTBs). Bitbases encode less information and are much smaller, and Gaviota GTBs can be used in a compressed format. If you are measuring engine strength, I would have all 3-men and 4-men varieties. If you are conducting tournaments, then you might want to get the 5-men files also. Keep in mind that accessing information from the hard drive slows engines down. So, if you use 5-men or larger bases, make sure your computer has plenty of RAM.

The most common bases are Nalimov EGTBs, Scorpio bitbases, Gaviota GTBs, Shredderbases,and Robbobases. Shredderbases, which are bitbases, are associated with the Shredder GUI (it seems that Shredder can use Shredderbases in conjuction with Nalimov EGTBs). Nalimov EGTBs are recognized and used by most GUIs and many engines. Gaviota GTBs are seeing widespread use. Scorpio bitbases are used by the Scorpio engine and several other engines. Robbobases, both Triplebases (bitbase) and Totalbases (endgame), are used by the Ippolit family of engines.

Links to Nalimov EGTBs and Scorpio bitbases can be found here. The Gaviota GTBs can be found here (you may find this tool useful for downloading the files). Alternatively, you can generate your own GTBs. Robbobases can be found here. 3men and 4men Shredderbases come with the Shredder GUI (which is a commercial product that includes the multiple world champion engine Shredder). If you buy Shredder 12, you receive a link to down load the 5men Shredderbases.

You will have to decide on whether each engine will use its own opening book, or the GUI will supply the opening book, or a set of opening positions (either in PGN or EPD format). The reason for this is that, if you start engine matches from the initial position, engines tend to pick the same opening moves each game. Opening books and positions create variation in the games, making engines play different lines.

Not all engines have their own opening book, so some would have to use the GUI book (if books are being used). Certain GUIs have their own proprietary book format, so such books can not be used (easily) in other GUIs. Common book formats include Arena (.abk), ChessBase (.ctg), Shredder (.bkt), ChessGUI (.cgb), and Polyglot (.bin). The first 4 are proprietary (though there is a method for using Chessbase's .ctg books in other GUIs by using the Aquarium GUI as an adapter). Polyglot books are able to be used by the Winboard GUI, as well as in Scid (and its branches such as Scid vs PC). Polyglot .bin is also the book format for several engines and can be used by any UCI engine in most GUIs by using Polyglot 1.4.67b as an adapter.

Arena books can be found here.
A couple of Polyglot books can be found here.
Some Chessbase, Shredder, and Arena books can be found here.
Books in various formats by Sedat Canbaz and Frank Quisinsky can be used for engine versus engine tournaments.

These are only a few of the books available. Plenty more can be found by using Google. And, with a little studying, you can learn how to make your own books.

Another option for engine testing is to use PGN files containing truncated games (usually no more than 12 moves deep) consisting of different lines. Inside the file (which can be opened by any text editor) you will see multiple games in this format (or something similar):

The bracketed items are called tags. You should find Event, Site, Date, Round, White, Black, and Result tags in every PGN header. And, of course, the body of the PGN contains the moves.

One source of PGNs of starting positions in which the final position is judged to be fairly even for White and Black is Kirr's Chess Opening Sampler.

Another option is to use an EPD file that contains actual positions from the opening that are judged to be even. The positions are encoded in a special format that contains the innformation of where each piece is located.Here is how the initial position looks in EPD format:

rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1

The lower case letters represent Black's pieces, upper case represent White's pieces. Any group of empty squares along a row are denoted by the number of such squares. Back slashes (/) delineate between rows. The lower case 'w' signifies that it is White's turn to move. 'KQkq' signifies that both White and Black still have kingside and queenside castling privileges available. A full description of the EPD standard can be found here.

A source of of EPD files suitable for engine testing can be found at Norm Pollock's site (look for posAfterX).

The ratings lists (other than SSDF) use books or starting positions that are judged to give little or no advantage to one side in the opening. The idea is that the engine's strength is the focus of measurement, not how good its book is. WBEC, ChessWar, and SSDF use the engine's own book, where available. In the case of WBEC and ChessWar, these are competitions. They are not really an attempt to measure engine strength, but judge what is the best chess playing entity, which includes engine books. I should note that the use of common books or starting positions by the ratings lists has been criticized, by those that see the ratings lists as competitions and those that feel tuned books are part of the chess engine. The method you choose should be determined by the goal you have for conducting engine versus engine matches.

You can either load engines that you have previously set up, or you can set up engines. It will be assumed that you need to set up some engines. Click on the '...' button. This will bring up a window that you will use to direct Winboard to the engine you wish to load.

After locating the desired engine, click on 'open' in the 'Chose File' window. The path to the engine will show up in the 'Load Engine' window. At this time, you can choose a nickname for your engine and specify if it is a UCI engine or a WB protocol 1 engine. Also, make sure you check 'Add this engine to the list'. Also, if the engine uses the WB protocol, but does not have a .ini (or .rc or the equivalent) file containing parameters for the engine, then the parameters may have to be entered the 'command-line parameters:' field. It is unnecessary for Gaviota, but an engine such as BugChess2 have parameters such as '-winboard' and '-hashsize [amount of hash]' that should be entered here. Check the documentation that came with the engine.

For UCI engines, after setting up the engine in Winboard, load it as the first engine and click on 'Engine', and then 'Engine #1 Settings... . That will bring up the UCI options available for that engine. For Gaviota, I can specify whether or not to allow it to ponder, use its own book, allow it to learn from the games it plays, use its GTBs, etc ... . The available options will vary for each engine.

Next, click on 'Options" and then 'Adjudications...'. This is where you determine if the engines will play with ponder on or off, the upper move limit for the games (I use 250 move limit), set the 50 move rule and the 3 move repetition rule, and the parameters for GUI adjudication.

Now, click on 'Tournament...' found under 'Options'. You will find multiple options for setting up a tournament. First, use the 'Select Engine' field to choose the participants of your tournament. The engines that you previously set up for Winboard will be found there.

You can specify whether to conduct a Round Robin tournament or a gauntlet. Alternatively, you can conduct a Swiss tournament using the built-in pairings engine to determine the pairings for each round.

There are several options for choosing the starting position for each game. If you have each engine set up to use its own book, then you would leave the fields 'Game File with Opening Lines:' and 'File with Starting Positions' empty and the box for 'Make all use GUI book by default' unchecked. This will make Winboard send the standard opening position to each engine. If you want to use the GUI book, then check the appropriate box (Winboard uses Polyglot books for the GUI book). If you want to use a PGN of starting positions, then specify the path to that PGN in the 'Game File with Opening Line' field. If you want to use an EPD file of positions, then specify the path in the 'File with Starting Positions' field. Checking the 'Stepping through lines/positions in file' will make Winboard send a new starting position for each new game. If instead the 'Use each line/position twice' box is checked, each position will be played twice with reversed colors (engines swap colors for the second game).

Be certain that you specify where you want Winboard to save the game files (remember to use a .pgn extension so that the game file can be opened by any chess database program).

Click on the 'Time Control' to access those options. You can choose repeating time control (X moves in Y minutes), or incremental time control (X minutes + Y seconds per move), or fixed time per move.

The 'Common Engine...' gives access to the settings that the GUI sends to all participants. Here, you can set the hash, number of CPUs, the EGTB path for Winboard, and the GUI book.

This is where you import engines into Arena. To import engines individually, click on 'New' and show Arena the path to the engine you want to import.

Once imported, you can edit the engine's name, make sure that the author information is correct, add command line parameters (check the engine documentation; many Winboard engines need the command '-xboard' in order to send and receive Winboard commands). set the type to Winboard or UCI, and point the way to the engines logo file (a small image file of the engine's logo; see ChessMosaic for examples).

Clicking on the 'Books' tab opens the part of the menu that allows you to make the engine use the Arena main book (more on that later) or assign an Arena-format book (.abk) to the engine.

Arena comes with an engines.ini file that contains information for over 200 engines (check the Arena web site for engines.ini updates). If you click on the 'Information' tab and the engine is Winboard protocol, you will see a button that will automatically determine from the engines.ini if the engine supports pondering, uses a book, can analyze, etc ... , If you do not want the engine to ponder or use its own book, make sure these boxes are unchecked.

Under 'Engine Management', you will see a tab labelled 'UCI'. Here you can set the hash to be used by every UCI engine, the common Nalimov EGTB location and common EGTB hash size, whether the engines should resign or not, whether to use the UCI filter (recommended for tournament mode).

There is also a 'Winboard' tab. Here you can specify how many CPUs a Winboard engine can use, how much hash, and the paths to various types of tablebases and bitbases. The option "Extended 'level' command for WB engines" allows Arena to send multiple different time controls in tournament mode. These options only work for Winboard engines that support the changes introduced to Winboard 4.4.xx. You may still have to edit the individual .ini (or .rc or etc ...) file for many Winboard engines.

If you have all of your engines in one folder, and all .ini files are already set up correctly, you may choose to install all engines in mass by clicking on the 'Installation wizard'.

Direct the wizard to the folder location (using the 'forward' button). Then check all engines you want to install. Click 'forward' and follow the recommendations. After installing, it would be smart to check on each engine and make sure the setting for each are correct.

For UCI engines, there usually is no .ini file. Instead, you access the UCI options via the GUI, which in this case is Arena. Click on 'Engines', then 'Manage', then 'Details'. Select an UCI engine and click on 'Start this engine right now!'. The engine should load into Arena. Now, click 'Engines' and then 'Engine 1'. Click on 'Configure'. This will bring up the 'UCI' options window for that engine. Set the options to what you want them to be (I recommend reading the information for that engine, read the forums, email the author, etc ..., to be certain what each option does).

If you choose to use an Arena main (GUI) book, then click on 'Book' in the main window. Click on 'Load' to locate and set which book you want to use as the GUI book (the GUI book supplies the opening moves for both opponents). Then click 'Save'.

Now, click on 'Engines', then 'Tournament'. You will see the 'Engine Tournament' window. You will be able to name the tournament, choose the participants, choose the tournament type (round robin or gauntlet), the number of rounds, and the time control.

To choose the time control, click on 'Level'. There are multiple options. The most popular options are Blitz, which is Fischer time controls (such as X minutes + Y seconds per move) and Tournament controls (40 moves in X minutes, repeating).

Click on 'Options'. You can choose three different variants of chess (normal, shuffle, Chess960), whether to use the initial position (choose this when using books) or to get the starting position from a PGN/EPD file (loading the positions sequentially or randomly). You can set the path for the PGN or EPD. If using a PGN, you can set how many moves deep to load from the PGN. Also, you can choose to play the same position with colors reversed. In addition, you can choose adjudication settings and whether to use ponder on.

Under 'Files', you will see where the tournament PGN and other associated files are being saved to. If necessary, you can change the destination. Under the 'Pairings' tab, you will see the results for each pairing (which can be edited if necessary). Under the 'Start/Quit' tab, you can specify how often Arena restarts and whether engines should restart after each game. Once all of the settings are correct, go back to 'Settings' and choose 'Save'. Click 'Start' to begin the tournament.