Chess has been a popular game for ages and has a multitude of variant games. It’s a fun game because it has a fixed set of rules but a massive number of possibilities. Some variants have minor changes, while others feel just vaguely like a form of chess. A rook may be weak in one variant while the most important piece in another.
Trying to play Xiangqi took me down a rabbit hole for working with chess systems on Linux. There are online systems to play, but there’s something about taking everything offline that still appeals to me. I also wanted more flexibility with what and how I played. Like with standard chess, different engines are like different players and some offer options or strategies others don’t.
To play chess on most computers, you need both a front-end and an engine (though some software packages both together). Some engines are smart, while others are weak. A hard computer can work as motivation or kill your dream depending on your goal and purpose for playing. Sometimes you want to lose to learn, but getting stomped by the highest level computer as a beginner doesn’t help.
Just trying to play chess that wasn’t international chess proved difficult with Linux. While Windows had easier alternatives, most of them were lacking in many ways (or expensive). Some of what we cover is specific to Linux systems, but the theory applies to virtually all OSes. I want to play a game the way I want to, not fight the computer to not annoy me with sounds and questionable engines. That being said, you need to understand what makes chess variants work on modern systems.
UCI
UCI (Universal Chess Interface) is a protocol which allows computers to have a standardized approach to chess games. It was released in November of 2000, but didn’t really take off until 2002 when it was adopted by Chessbase. UCI is an open protocol, so it’s easy for basically anything to adopt without having to deal with proprietary bits or arcane licensing. Virtually every modern Chess front-end program supports UCI.
There are pros and cons to the UCI approach over the older XBoard engine style, but UCI arguably has made chess variants much more accessible. UCI is stateless in many ways, which basically means each move is calculated without keeping track of it in the engine. The GUI running the engine needs to provide all relevant data with each move.
UCI does get a bit of flak because it offloads openings to the GUI as well as delegating certain responsibilities to the GUI which were traditionally managed by the engine. Whether this is the cost of the polar of progress or just reinventing the wheel is a matter of debate in some circles. UCI has made my life easier for enjoying a hobby, but I’m not the one maintaining or working with anything low level.
UCI also has derivatives for Xiangqi (UCCI) and Shogi (USI). These are enhancements to the protocol for specific game types, but UCI is flexible enough to allow engines for other chess variants directly with the robustness of the protocol. Variants of UCI just try to make it easier to start with something oriented around the specific game they’re building off of.
About the Engines
Most chess engines are a drop in to add to some kind of GUI (even a text one). You need a GUI to use a UCI engine (unless it includes a GUI on its own). We’ll dive into this more down the line, but installing or downloading an engine is just one step in the entire process.
There are many common chess GUIs which range from text to graphical. You could theoretically communicate with the engine directly, but this is in the realm of writing your own basic chess program. Just keep in mind that installing an engine is just the first step in actually playing chess (or a variant) on a computer unless you get a program which includes the entire package or a proprietary engine with a proprietary GUI.
Fairy-Stockfish
Fairy-Stockfish is one of the most well known engines which supports many chess variants. It supports every variant from my previous chess variant article. This engine allows you to use the base engine of Stockfish to play different versions of chess with fairy chess pieces or whole different layouts.
Stockfish, from which Fairy-Stockfish is derived, is considered the strongest free chess engine as of writing. While there’s a continuous ebbing and flowing for the ranking, Stockfish doesn’t really dip all that much as far as I know. Stockfish has benefited from efficiently updatable neural networks (NNUE) in newer versions. This specific update and enhancement actually came from Shogi programming, which is one of the more different chess variants. The strength of any specific game will vary depending on how well the underlying chess engine functions with the different rule constraints and altered pieces.
For Debian or Ubuntu, all you need to do is run sudo apt install fairy-stockfish
(or change out apt for aptitude or similar). The process is roughly the same in other Linux distributions, though the package name and package managers are probably different. For Windows, you can download an executable from Github and Mac can use MacPorts or Homebrew. There may be a bit more work required than the average package depending on which you use, but ultimately, you can build from source if nothing else.
Sjaak II
Sjaak II is a chess engine created by the same programmer as Jazz and Leonidas. Jazz is a stronger engine than Sjaak II, but Sjaak II supports many chess variants. Some work better than others, and some only work when disabling move legality checking which can make it much harder for newer players to play (or easier for the wrong reasons).
I have no idea how strong it is, and was unable to find an exact comparison or benchmark, but it’s definitely stronger than most amateurs from what I can tell. It beat me on the hardest difficulty at basically every variant I can play. I’m in no way an expert, especially not at the chess variants I tested, but it definitely felt like I was playing a person more than a 90’s chess game.
Sjaak II is flexible for certain variants, but others are more limited. That said, it can play Xiangqi and Shogi (as well as several Shogi variants) which are the most popular variants. It has rudimentary support for some variants which require special tweaks which is less than ideal (granted, I didn’t really run into any for any variants I knew with the newer version).
You can install it on Debian or Ubuntu with sudo apt install sjaakii
or similar. The author provides builds for Windows and Mac here, though Mac users could use Homebrew or MacPorts as well.
Fairy-Max
Fairy-Max is an engine which supports FIDE chess at around a 1900 Elo as well as many chess variants. The goal of this engine isn’t just to go for as brutal an opponent as possible, but to aim for a human level experience which allows for more growth and enjoyment. If you’re just playing for fun, anything past about 2000 Elo (or much, much lower for most of us) is pretty much pointless.
Fairy-Max is derived from micro-Max. The point of these engines is to be compact but also playable. It might beat you almost every time, but there’s at least some hope to win sometimes without limiting the difficulty. Fairy-Max just takes the basic formula and applies it to fairy chess and chess variants.
Fairy-Max includes different engines for Shatranj and Xiangqi via shamax and maxqi. The games are different enough to have different rules and different strategies. These engines are largely different in how they prioritize rules for the specific games which can impact the endgame for Shatranj.
Chess GUIs
Most of these engines work with UCI, but UCI is a protocol and not a way to play. You need an application to actually play chess in a way which is familiar. This method can range from a command line interface to a full on graphical interface. There are also other engines and protocols depending on how you play too.
With UCI engines, the GUI handles both the display and interactions, as well as the opening dictionaries and similar. There are many chess programs, ranging from command line to graphical which can enable you to play chess and its variants. That said, some are easier to work with than others.
Some graphical applications include their own engine or system to enable play which aren’t usable elsewhere. Others require configuration of the engine and only exist to facilitate playing chess or similar. Many of the all-in-one GUIs will excel at a specific variant, but rarely offer more.
Xboard / Winboard
Xboard and Winboard are the most well-known and most supported chess programs I know of. Despite the fact they are relatively ugly (or at least dated), I was yet to find a chess variant I couldn’t play. You might have to play with the graphics settings or make some adjustments, but most fairy chess games or world variants had some support.
There are programs other than Xboard or Winboard, but most of them were more a pain than they were worth for playing variants. Variants with different pieces such as Xiangqi or Shogi were even more trying without using specialized GUIs (or Xboard). While it may be ugly, it works and it works well. KDE, Gnome, and similar may have their own chess programs, but I tend to stick to GTK or QT apps.
Xboard and Winboard aren’t the most aesthetically pleasing environments for playing chess, but they are functional. You may feel you’ve been thrown back to the 90’s, but everything is easy compared to most alternative, non-specialized GUIs. I found Xboard (and by extension Winboard) to be the easiest tool for the job. Windows may have multiple alternatives which are easily downloaded, but Winboard and Xboard just plain work with more chess engines and variants than they don’t.
Using Xboard
This mainly applies to Linux and BSD users, though it can easily be applied to Winboard. A lot of interaction I do with Xboard is done from the command line. Certain things are easy from the GUI, but sometimes the command line is the only way to get things done effectively.
Xboard and Winboard share most of the same options (though you may need some specific adjustments for Winboard) if you change the -
to a /
. We’ll start with the most important options for making things work and dive into some of the common settings. The man pages have more, but are overwhelming in the beginning.
There are also GUI settings to consider when working with Xboard. We’ll hit the command line settings first then advance to the GUI to make things easiest to use. I learned how to work the GUI after learning how to manage Xboard from command line. This is probably the most tedious part of using Xboard or Winboard, but can make playing chess fun or a pointless struggle.
Xboard Commands
The most common option you’ll use when playing chess in general is the engine you play against. This option is selected by choosing -fcp (first chess program) which indicates the primary engine to use. An example of this would be xboard -fcp fairymax or xboard -fcp sjaakii. You can extend this to -scp for secondary engine as well. You can set this based on your path or based on absolute path depending on how a chess engine is installed.
If you’re looking for more than just chess, you’ll need to specify a variant. You just need to add the option -variant and an acceptable variant name for the engine. For instance, for Xiangqi, you may use xboard -fcp maxqi -variant xiangqi or for Shatranj xboard -fcp shamax -variant shatranj. How you play a variant is somewhat standard, but you need to make sure a given engine supports it and that you know how to call it (some engines are a little different).
Difficulty is another common question for working Xboard. I don’t know how to do it in the GUI, but you can try limiting the depth with xboard -fcp [engine] -variant [game] -depth [number] so that the chess engine can only look so many moves forward. This has the effect of limiting the difficulty, though it can break some engines if the number is too low.
There are other options such as -st [minutes:seconds] to limit the search time for moves. You can also combine these options with -smpCores [number] to enable or starve certain engines for processing power. Individual engines also may have a difficulty option, but it depends on the engine.
More Xboard Options
Once you get the difficulty dialed in, you may want to get more competitive with timing and similar. We’ve dealt with time options for engines, but what about time options for you? For instance, when we limit the think time of the computer with -st [minutes[:seconds]], we also remove the clock. Certain options have certain implications and a single blog article can’t contain them all since Xboard is a beast of a chess program.
You can determine whether there’s a clock or not with -clock [true|false]. When false, this allows you as much time as you need, but individual engines are still bound by certain rules. You also have the option of using -mps [moves] (moves per session) or -inc [seconds] (to increment the clock by [seconds] per move). Each of these has its own implications depending on what you’re doing with your chess game.
Another option which can help you when you play chess on a weaker machine is -niceEngines [priority]. Negative numbers correlate to higher priorities while higher numbers are lower. You can set the engine to negative, but you shouldn’t. This can make chess burn test your CPU or just slow the game down a little. Done with other limiting options, this can also artificially limit the game (for instance xboard -fcp maxqi -variant xiangqi -niceEngines 15 -st 0:10 -depth 6 -smpCores 2).
Setting Up Xboard
The Xboard GUI has many options which can make playing chess more or less fun. While you can control some of the same things in the GUI as with command line, it’s typically easier to focus on the graphical portion from the GUI. Xiangqi looks a lot uglier on a standard chessboard.
To change the presentation of the board, click View and look for Board. It should look like follows.
You may have fewer (or more) options depending on how you installed Xboard or Winboard and the graphics may differ a bit. You can pick a theme or use # ORIENTAL THEMES for Xiangqi or Shogi on most systems. You can configure colors and similar as you want with the options in this panel.
From Edit you can also move back or forward moves as necessary. You can also reset the game or play to the end (assuming the game has ended) to make puzzles or replay a bit of a game from some point in. File allows you to set a variant or save and load games and positions as necessary.
You can configure the engine from Engine if desired. Options allows you to mute sounds or configure multiple settings. For instance, Time Control from Options allows you to configure many of the time options for the game if you would like.
The GUI offers much of the power of command line, but command line is easier if you’re used to it. It’s one thing to open a program and mess with settings, it’s another to have a shortcut (or script snippet) you can easily configure. I might not change a lot of options often, but it’s easier to alter minor bits in a script to fit my play than to go through and edit options in different menus.
Conclusion
There are far more options from SCID to countless tweaks for Xboard. While it’s easy to play chess, some of the variants and different games are hard to get into. This article allows you to get going in Linux, MacOS, and Windows with minimal effort.
Xboard and Winboard are the most documented and easiest systems to get going in. There are others, but these are the classics which support almost anything on anything. You don’t need to worry what variant you want, you just need the processing to play.
I started just wanting to play Xiangqi, but it opened a world of possibilities with different engines with different strengths and different options. I also got a world of chess games unlocked on my computer without resorting to more limited, proprietary engines (or paying). You can play a basic game online, but can you customize every option at every level including the engine?
These tactics and techniques don’t just limit you to chess variants, they just give you more control on each aspect of the game. It’s easier to learn more and advance when you can control the options of play. Limiting a computer can make you confront a closer opponent to learn more. Swapping out the opponent can make you move to different strategies or give theory a test.
It doesn’t matter why you want to play chess or its variants, controlling the system gives you more power to play how you want. You can tweak and control many aspects to open up more levels of play with more possibilities for your enjoyment of the game. I don’t want to get curb-stomped by a computer or condescended to by a feel good engine; I want to learn more. Technology should work for you when you play, and with a little effort, it does.
Image by schach100 from Pixabay