Linux chess program PyChess

Checkmate

© © satori, 123rf.com

© © satori, 123rf.com

Article from Issue 187/2016
Author(s):

Powerful and flexible chess programs have been scarce on Linux. But PyChess sees the free operating system checkmate other platforms.

The game of chess is one of the oldest strategic board games known to humankind. Despite its centuries-old history, chess has lost none of its fascination, and the advent of computer technology in recent decades has not stopped the game of kings. Computers with multi-core processors effortlessly beat most human chess players. The market for chess programs is overrun by countless more-or-less sophisticated competitors that spoil users for choice.

Linux did not play a major role as a platform for chess programs for a long time. Although all major desktops have had graphical chess programs for many years, they have been unable to assert themselves because of functional deficits, poor performance of the chess engines, and a lack of compatibility with the commercial offerings from the Windows world. It was only with the publication of the Java-based chess program Shredder [1], available for Linux for the first time in 2006, that the tide began to turn. Shredder is now regarded as one of the most powerful commercial chess programs in the game, but free applications under Linux have also made significant progress.

Most of the current crop of chess programs on Linux are made up of two components: The graphical user interface defines the gaming experience, and above all, supports additional features for advanced users, such as game analysis or replaying matches for training purposes. Underneath the interface, the brain – the actual chess program – interacts with the user. These engines do not have a graphical interface but simply compute the moves.

For many years, free chess engines were unable to keep up with their commercial competitors, but this has now changed. When Stockfish [2] appeared on the Swedish ranking list of the strongest chess engines in 2015, this meant that two free chess programs had made it into the top ten [3]. Crafty [4], another free engine, has made the headlines on several occasions through its outstanding achievements.

The GUI and the chess program in these solutions communicate via standardized protocols. The quasi standards are the Chess Engine Communication Protocol (CECP), also known as the Xboard protocol due to the graphical interface of the same name, and the more-recent Universal Chess Interface, UCI.

PyChess

PyChess, a recent development among graphical interfaces for chess programs, supports both CECP and UCI. Originally designed for the Gnome desktop, the Python chess client is based on the GTK libraries. However, the current version 0.12 "Anderssen" also runs perfectly on Linux desktops that do not rely on GTK components. The software can now be found in the repositories of many distributions; and, the project offers precompiled binaries and the source code on its website [5].

After installation, check out the Games submenu in your distribution for a PyChess entry. When you press the starter, the program opens a nondescript window, where you can first select your color and the chess engine to use from two selection lists. In the lower part of the window, you have the option to sign up to the FICS chess server on the Internet, where you can then play live games, by entering a user name and your password. You can enable the desired function by press the Start game button to play a game locally or pressing Connect to FICS to start an online match (Figure 1).

Figure 1: Online or not online – this is the question.

PyChess comes with its own chess engine called PyChess.py, which is used by default when you launch the software. Below the selection box, you can adjust the skill level of the program. You can add other engines without much effort: The package managers of most Linux distributions will give you packages such as crafty, fairymax, gnuchess, phalanx, sjeng, and not least stockfish, which you can then install via your package manager. Additionally, the developers of PyChess provide multiple chess engines for downloading [6]. After restarting, PyChess should find the desired engine automatically and offer you a choice.

Settings

After you click Start game, the actual program screen appears. Below the menu bar at the top, the screen is divided into the two-dimensional chessboard on the left side and several display panels on the right. In the lower section, you will also find a display area with two tabs: Tips and Engines.

All the display areas are empty at the beginning of a new game, but they fill with data as the game progresses so that you can follow every game later on without any problems. Before the first game, it makes sense to first configure the software to suit your own needs in the Settings menu.

The corresponding dialog lets you add various options to the program window via the General tab arranged on the left. Among other things, you can display the coordinates of the chessboard and the captured pieces.

You can also display the move times and evaluations within the program window. In the second tab, Information, you can set the opening move and select an engine for the analysis function. The selection boxes automatically list all the available engines.

In the middle tab Sidebars, you can then define which basic information is displayed in the program window: Turning off unnecessary functions removes the clutter from the interface (Figure 2). Then, from the list of active display areas, you can select one or more areas and disable them, pressing the Active button below the settings window.

Figure 2: You can configure the information you wish to display in the PyChess program window.

The two rightmost tabs, Themes and Sounds, are used to tune the visuals and sound of the software. For example, you can tell the program to notify you of program messages with acoustic feedback or to adjust the chessboard visually to suit your wishes; PyChess features more than three dozen view options.

Espionage and Tips

In the View menu, you can check the Tip mode box to see tips for your next moves during the game. This box particularly benefits weaker players who want to improve their skills in the game. Spy mode, which is enabled in the same menu, shows you what the chess engine is "thinking about;" the moves appear directly on the board in the form of red arrows for your opponent's next moves.

If you want to turn off any additional ads and only see the game board with the clock on the screen, uncheck the Show sidebar box in the View menu. The sidebar goes away (Figure 3), although PyChess continues to update the list displays in the background, and you can view them during the current match by pressing Show sidebar.

Figure 3: The chessboard without additional displays.

To make sure you can quit a game or track a played game at a later date, PyChess lets you save the game. The Save game and Save game as options in the Game menu let you store the current game on your hard disk in the standardized PGN format. Most chess programs support this text-based format. Additionally, there is nothing to prevent you from exchanging data via the PGN format with chess databases such as Scidb. The Load game and Load last game options, also in the Game menu, let you reload the desired game at a later date.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Shredder 9

    Shredder 9 promises world championship chess on your home computer. We took a look at the new Linux version of the famous Shredder chess tool.

  • Free Software Projects

    In this month’s Projects on the Move, we observe the battle between man and (chess) machine and check out the free Colonization clone. Also in this issue, tools for Linux users who find themselves facing the Windows prompt.

  • Knight's Tour

    If you're looking for a head start on solving the classic Knight's Tour chess challenge, try this homegrown Python script.

  • Gifts for Gamers: Some End-of-Year Recommendations, Part 2

    More games for Linux and open source - a large choice for every taste. Strategy, chess, and more.To be continued.

  • FOSSPicks

    Graham Morrison tears himself away from updating Arch Linux to search for the best new free software.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News