develia.org
»» i686 slackware tarballs..
»» software projects..
»» and much more..
 NAVIGATION 
 OPTIONS 

 INFO 
*** develia.org ***
by Giacomo Lozito
© 2004-2010

valid xhtml 1.0valid css!
powered by apachepowered by php
valid rss 2.0get firefox!

NO software patents in UE
 DOCUMENTS 
Playing chess on Linux.

1. Introduction
2. Chess interfaces
3. Chess engines
4. Links and credits


 Introduction

This article is dedicated to all chess players, novices and experts. Even if the information in this text always refer to the Linux operating system, they are useful for any UNIX-like system. Playing chess on Linux is interesting and entertaining, since there are many programs available and many different chess engines.

First, let's point out this important distinction, on Linux we are going to need two programs: one providing the interface (usually a graphical one, with a nice board, piece sets and many options too) and one providing the artificial intelligence that is going to play against us (a "chess engine").
If you compare this to real life, think that we're going to need both a chessboard and an opponent; then, nothing will prevent us from playing with different opponents on the same chessboard, or with different boards against the same opponent.

However, you'll rarely have to search for two different programs, since Linux distributions already provide you some interfaces and some chess engines, sometimes making even a single binary package out of everything. In example, this is the case of Slackware Linux; in its Gnuchess tarball, it provides two interfaces (xboard and eboard) and two chess engines (gnuchess and sjeng).
Small note, probably useless: if you want to play on internet or on a network against another human player, you are going to need the interface only, there's no need of chess engines.


 Chess interfaces

xboard Let's start by getting a chessboard, alas by choosing a chess interface from those available for Linux.

The first chess interface is the old good XBoard (picture to the right), a light client that can run on any UNIX-like system. XBoard allows you to play with all the chess engines that supports the XBoard protocol (which has become a standard for chess engine communication).
XBoard also works as ICS (Internet Chess Server) client, so you can use it to play against a human opponent over the network. You can also play against a human player using cmail, a program included with XBoard that uses email to manage online games.
XBoard supports the PGN (Portable Game Notation) standard to save and load games. So you can look at matches in their current state, but also examine all previous moves, reconstructing the story of a game from its start. Last but not least, XBoard can be used as an electronic chessboard (without artificial intelligence), on which you can move both black and white pieces in order to practice or analize specific situations.
You can get a lot of information on the XBoard man page. I'll just write below some of the classic launch parameters.

>> xboard
By simply typing the xboard command without any parameter, you launch XBoard along with the first chess engine available on the system (gnuchess, usually).

>> xboard -fcp "gnuchessx" -fd ./games
In this case, the first computer player (fcp) is the gnuchess chess engine; the -fd parameter is used to specify the working directory for the first chess engine (gnuchess), where the engine may place its resources, like learning files. This is a very common syntax used to specify a chess engine that is not the default one.

>> xboard -fcp "phalanx" -fd ./games -scp "sjeng" -sd ./games -mode TwoMachines
Wanting to see two chess engines (or two instances of the same engine) playing one against the other? This is exactly what we obtain with the syntax above, note the parameter -mode that sets the game mode (we can do it from the XBoard menu too).

Even if the XBoard look is customizable, probably it doesn't reach the great look and feel offered by modern KDE and GNOME applications. As you would expect, other chess interfaces appeared, taking advantage of the nicer UI toolkits (GTK and QT), with better usability and with even more options available.

knights Two nicer interfaces are eboard and Knights. The first, eboard, has been designed with special care for network playing. It uses the nice GTK+ ui toolkit, and allows to play with all the chess engines that supports the XBoard protocol. Network playing with eboard can be done via ICS, but also via direct connection with another eboard client. It is very customizable (board and piece sets too) and it seems that its interface will be ported to GTK+2 in the future.

Knights (picture to the right) is a very cool chess interface for KDE. With a nice look (very customizable, with themes support too) and a high usability, Knights allows you to play with all the chess engines that supports the XBoard protocol or the UCI (Universal Chess Interface) protocol. Of course you can play online with it, via server ICS or via email. Both eboard and Knights supports game loading and saving in PGN (Portable Game Notation) format. A precompiled version of Knights, for Slackware Linux, is available in develia.org tarballs archive.

Probably there are other chess interface available (but I never tried them), one of these is glChess, a program that will let you play on a three-dimensional board; it allows, like others, to play with all the chess engines that supports the XBoard protocol.


 Chess engines

There are really a lot of chess engines available. WBEC Ridderkerk is a very useful website, that will let you know and appreciate the characteristics of each engine (in example the interface protocol, like XBoard or UCI). On Tim Mann's Chess Pages there's a list, a bit outdated, of chess engines that supports the XBoard protocol.
Of course, we should choose a chess engine that works on Linux and that uses an interface protocol supported by our chess interface (usually we want the support for XBoard protocol). More, we should check if the chess engine is customizable, so we can tune the difficulty and play balanced games.
Rating a chess engine is not easy, the WBEC Ridderkerk website anyway shows ratings and information about the "skill" of a chess engine. Rememeber that the skill strongly depends from the resources used by the engine: CPU power, compilation optimizations, available CPU time and resources like opening books, ending tables and whatever.

Unless you're an expert player, you'll soon realize that tuning the resources for the engine is not a facultative option, but it is fundamental in order to play a balanced game. Otherwise, you risk to be sistematically defeated and, even if this may be useful to learn chess and become a better player, it may become frustrating for the novice player (after all, it's nice to win once in a while!).

In fact, one of the frequently asked questions when playing chess on Linux is: "the chess engine is too strong, how do I weaken it?". Well, there are many ways to tune it.
  • First, we can disable the "ponder" option; normally, while we're playing our turn, the chess engines still thinks and calculates possible moves; with ponder disabled, it will think only during its turn. Note that if the ponder option is activated, the cpu usage will stay at 100% for the entire match duration.
  • We can set a maximum turn duration, forcing the chess engine to make its move quickly. Lesser think time available for the engine, lesser game difficulty.
  • We can tell the chess engine to ignore its opening books and other similar resources, this way we'll weaken its initial strategy.
  • Each chess engine offers many parameters that can be changed, and the changes will influence its performance in the game. In example: cpu resources for the engine, depth of the calculation, auto-learning and much more.
At the time I'm writing, I usually play with four engines: GNU Chess, Sjeng Free, Crafty and Phalanx. Each of these has got its special parameters, look at their man pages for more information. Anyway, they all support the XBoard Protocol.
Phalanx (GPL-licensed) is the one I recommend for novices, because it's easily customizable. Without need of changing depth and time of calculation, it allows you to tune its skill using a nice "difficulty level" parameter, that goes from 0 (difficult) to 100 (easy). A precompiled version of Phalanx, for Slackware Linux, is available in develia.org tarballs archive.

>> phalanx -e100 -l- -b-
If you start phalanx with these parameters, the engine will play at a very easy level, without learning and without opening books. Of course, we want to play against phalanx on XBoard, so we would type:
>> xboard -fcp "phalanx -e100 -l- -b-"
In the same way, using another chess interface like eboard or Knight, we'll be able to pass the engine parameters by adding them in the engine dialog window provided by the interface.

It should be noted that chess engines, in order to work, do not strictly need a chess interface. They're programs on their own (with textual interface), even if playing against them on the command line may be a bit uncomfortable (well, at least Sjeng draws an ASCII chessboard for you :).


 Link e crediti

In addition to the previously suggested links, WBEC Ridderkerk and Tim Mann's Chess Pages, I'd like to mention the web pages of the FICS (Free Internet Chess Server), one of the oldest and largest Internet Chess Server, with over 150000 registered users.


This HOWTO has been written by Giacomo Lozito, alias the maintainer of develia.org, with patience and passion.
If someone finds the howto very useful, he's free to publish it on his website, as long as he keeps these credits unmodified (link to develia.org included) and he's so kind to let me know about it by email.
All the trademarks, company names and products mentioned and/or illustrated in the howto are the property of their respective legitimate owners.