ELECTRONIC T-NOTES


CHESSBASE USA'S WEEKLY ON-LINE NEWSLETTER


FOR THE WEEK OF JUNE 9, 2002


ENGINE MATCHES IN FRITZ7

by Steve Lopez

The final World Cup tournament is here!! Alllll riiiiiiiight!! I know that my fellow Americans are largely non-plussed (since soccer's not the most popular sport on this side of the pond), but I'm pumped! (especially so after the U.S.-Portugal match). The whole Cup aura has me in the mood for all sorts of competitive spectating, so this week we'll look at how you can set up a chess match between two engines in the Fritz7 interface. Last week we discussed the "modular" engine concept (engines that can be "plugged in and out" regardless of the user interface); engine tournaments are a great example of how this concept works.

The first step (after firing up Fritz7, of course) is to set your time control for the match (see the ETN issues for January 9th and 15th, 2000); then go to the File menu, select "New", and then "Engine match" from the submenu. You'll see this dialogue appear:

This is where you'll define your parameters for the match. You'll see that I've already set up a 24-game speed (game in ten minutes) match between Fritz and Crafty, but you can choose any of your available chess engines instead. We'll get to the engine selection in a minute.

You'll want to name your match (this information will appear in the "Tournament" line of the game headers when the games are automatically saved). Pick anything you like; my name wasn't terribly descriptive (in fact, it was a default provided by the Fritz7 interface), so I'll probably want to change it before finalizing the match criteria. Type your match name in the box next to "Match title".

We'll skip the engine and book selection options for now (we'll come back to them in a minute) and instead jump down to the box for setting time controls. We've already set the time, but if we change our minds before starting the match we can make another selection in this box and get the dialogue for the selected type of time control.

Choose the number of games that will be played and type the number in the appropriate box. "Move limit" allows you to truncate the number of moves that will be played. Why would you want to do this? Some users might be interested in just the opening and early middlegame that the programs will play, so limiting the number of moves saves time by cutting off the game length. Also, this allows you to evaluate certain opening lines -- at the point at which the games end, the program will slap an Informant-style evaluation symbol on them so that you can see the evaluation of the final position; this is useful for testing the "soundness" of various openings. However, most users will want to see full games, so leaving this set at the default of "600" will do nicely (and very few chess games run past 200 moves; the default setting will allow games of up to 300 moves, as this number is measured in the dialogue in plies [that is, half-moves]).

"Permanent brain" is best left switched off. When you use Permanent brain in a game that you play against a computer, it allows the engine to think on your time (that is, the engine will still calculate when it's your turn to move) and thus makes the program play somewhat stronger. Selecting this option is an engine vs. engine match however leads to some quirky results -- the two engines will be "fighting" over processor time and you'll never be quite sure which engine won the tug of war. If you're trying to test which of two engines is stronger, Permanent brain will taint the results because neither engine will get full use of the processor (and you'll never be sure whether or not one engine got a disproportionate amount of thinking time and how much more).

And, while we're on the subject of fair play, it's only fair to let each engine have an equal number of games with the White pieces, so be sure to check "Alternate colors"; selecting this means that the two engines will switch sides before starting a new game. However, if you want to test an engine's play with one particular color, you can uncheck this box and the "White" and "Black" choices at the top of the dialogue will apply to all the games of the match.

Going back up to the "White" and "Black" dialogues, these allow you to select which two engines will play the match. To select an engine, click the "Define" button to get the following dialogue:

The options you get here could be (and have sometimes been) the subject of entire ETN articles, so we'll do the short version here. The scrolling window at the top of the dialogue allows you to select an engine. The "Book choice" button brings up a dialogue that lets you choose an opening book. As previously discussed in ETN (March 10, 2002), it's typically best to let an engine use its own opening book to maximize its potential results. However, you can use literally any opening book you want (for example, you could create a new book on a certain opening and let both programs use that book -- in effect, you're creating a "theme" match, in which both programs are required to play a predetermined opening). You can further tweak the way the engines use the opening book by clicking the "Book options" button and resetting the parameters.

You can also tweak the engine itself by checking the "Parameters" box and then clicking the "Engine parameters" button. Fritz' basic engine parameters were previously discussed in ETN on March 7, 1999. We looked at revaluing pieces in Nimzo (and this is now a new feature in the Fritz7 engine, by the way) in the article for June 4, 2000. And some parameters unique to other engines have been discussed in various "preview" issues of ETN relating to these engines.

"Hashtable size" was discussed in-depth in ETN on February 24, 2002. The "Elo" setting has absolutely nothing to do with how strong the engine will play. When each game of the match is completed, it's stored in a database (more on this in a minute). The "Elo" setting assigns a rating which is displayed next to the engine's name in the header shown in the game list (this is similar to entering and saving your own tournament games into a database and entering your rating and that of your opponent into the "Save game" dialogue, to be displayed in the game's header). If you don't want to manually assign a rating to the engine, just leave this setting to the default of "0".

Now we get to the tricky part: the "Openings DB" button. We'll start with the explanation given in the Fritz7 Help file and elaborate from there:

Openings DB: This is a special feature which allows you to select a database of games. The engines load each game, jump to the end and play on from there. This function allows you to stage theme tournaments and also conduct interesting experiments, like the Nunn match, in which each side must play ten representative openings positions with black and with white. These positions are included on your program CD (Nunn.cbf) [since changed to Nunn.cbh in Fritz7 -- SL] and were selected by Grandmaster John Nunn. They have become the standard for testing chess engines without the influence of the openings book.

I remember a very heated debate in the Compuserve Chess Forum back in 1994-95, which occurred in the wake of a large computer tournament. Several participating programmers alleged that their opponents had used a variety of specially "cooked" opening books, prepared to exploit flaws in other competitors' play. For example, if Program A exhibits problems in flank openings, the programmers of Program B might create a special opening book that leans toward such hypermodern openings and then use that book when playing Program A. There was much wailing, lamentation, gnashing of teeth, and rending of garments among programmers in the Forum over this issue.

In the wake of this, Grandmaster, PhD, and all-around brainy mug John Nunn devised a simple, yet not so obvious, solution. What if computer vs. computer games started from a dead-even middlegame position, rather than from the standard opening position? He devised a set of such positions (now known as the Nunn testset) and encouraged programmers to use these positions in high-level chess computer competitions.

The "Openings DB" button allows you to load the Nunn testset and use these positions as starting positions for engine vs. engine matches, exactly as described in the Help file excerpt above. In fact, there are several testsets available for such use, located in the folder C:\My Documents\ChessBase\testsets -- clicking the "Openings DB" button brings up a dialogue that lets you select one of these sets.

Finally, the "First game" box (in half-tone unless a testset has been selected) lets you start the match from a game other than the first one in the testset database. For example, you could type "8" in this box and the match will start with the eighth game in the testset.

If you want to have two programs play out a match using a particular opening variation, just enter the variation's moves manually, save that variation into a separate database, and then load that database as a "testset" using the "Openings DB" button.

When you finish setting the match parameters, it's time to let 'em rip! Click the "OK" button in the "Engine vs. Engine" dialogue and the match will begin. A new display appears that lets you watch the match in progress, showing the chessboard and engine analysis panes for both chess engines. Three buttons appear at the top left of this screen. These allow you to stop the match, adjudicate a game (as a timesaving device -- for example, one engine is up by a Queen, a Rook, and a bunch of pawns vs. a couple of minor pieces. The game's certainly a win for the first side, but it will take forever to play out to mate. So you can click the "adjudicate" button to end the game and manually assign the win to the first side), and display a crosstable of the match's results so far.

If you want to run a match when you're away from your computer but still want to (manually) replay the games later, this is simple to do. After the match is over, open the database window (by hitting F12 or clicking "Open database" in the File menu). In the pulldown window on the upper right of the database window, select the database C:\My Documents\ChessBase\CompBase\EngMatch.cbh -- the games of your engine vs. engine matches are stored in this database. You can double-click on a game in this list and reply it on the main chessboard screen in Fritz. You can also load this database in ChessBase and replay the games there if you like.

Until next week, enjoy the battles and have fun!

You can e-mail me with your comments, suggestions, and analysis for Electronic T-Notes.