one-eyed-king

So then, what's all this all about?

I just wanted a simple chess program to practice against. Casual, like.

What I found is a dedicated band of chess-engine builders locked in an algorithmic arms-race. This has produced a growing selection of free chess bots for us mere mortals to enjoy.
A big thanks to their generosity!

I started compiling the better-known engines on an abandoned Raspberry Pi v1, just to see how well they might work.
To my delight, the single core 700MHz ARMv6 CPU is a perfect platform for this purpose. It's not goig to handle a bot-battle, but it does provide a nice, private chess server
for you and your friends to enjoy. It's the one-eyed-king!

All the engines here will have a full-strength ELO rating of at least 2500. Stockfish6 is current king - at full strength it's ELO rating is 3250 and still improving.
For comparison, Magnus Carlsen's maximum ELO of 2882 is the pinnacle of human achievement.

Engine strength on the Pi - whilst obviously somewhat limited by the meagre hardware - should still be enough to crush most club players.

Where possible, the engines have been compiled from latest-version source. I have exposed the key skill settings for some engines, but tuning will require a lot of experimentation.
Nevertheless, they all give a good game on default settings, and there is enough variety of style to justify the inclusion of each.

Next steps:
Play as black, optional chess clock, Ponder, games database, Human vs Human and Bot v Bot games, locally and on the network, e-mail chess,
Position analyser, GUI (xboard/pychess) over HDMI, and ...

Eventual aim is to host on a GitHub repo and prepare a ready-to-go ISO file for Raspberry Pi owners, many of whom have probably upgraded to PI 2 by now, are and looking to re-purpose.


WebUI courtesy of Dr. R. Urban and chessboard.js.

Contact stimresp at gmail.




Engine Settings Explained

Movetime

The engine should be allowed to 'think' for this number of milliseconds. Maximum is usually 5 seconds, but default settings around 500ms are sufficient to out-fox most human players.
At 500ms, most moves will usually translate back to the board within 3-5 seconds. At longer movetimes, the engine may take up to 30 seconds to respond, and possibly longer in complex situations.

Skill Level

Scale of 0-20, but don't be fooled, even the lowest settings they can still serve-up some serious ass whoopin' if you're not careful.

Contempt

"Contempt of draw", i.e. the extent to which it prefers to continue a game it considers level rather than draw. The value is expressed in centipawns (e.g. 25 is a quarter of a pawn). A negative contempt value means that the engine prefers to draw rather than continue even with a slight advantage. Technically, an engine evaluates a draw as minus the contempt value. A positive contempt value is useful in avoiding quick chance draws against weaker opponents.The Contempt Factor reflects the estimated superiority/inferiority of the program over its opponent. If the engine has high contempt for its opponent, it should adopt a more attacking style.

Aggressiveness

Makes the engine more or less aggressive.

Cowardice

Define how defensive towards its own king the engine should be.

Mobility - Midgame/Endgame

A factor for how much the engine will value piece mobility. More mobility leads to more attacking and unpredictable positions.

Hash

Sets the size (in megabytes) of the the transposition ("hash") table. The larger the hash table, the more effective the engine's search. A doubling of hash table size will result in a moderate increase in playing strength
The hash table is a form of content-addressable memory. Instead of just blindly generating all legal moves at a position and then going down these lines of play, the hash table is first queried about the position. A hash table can effectively give near-perfect move ordering and hence, very efficient pruning (the removal of inviable lines of play from the search tree).

Pawn structure

Describe the positions of all the pawns on the board, ignoring all other pieces. Pawn structure encompasses a broad range of ideas, from the general shape of the pawns (such as closed or open) to specific characteristics of individual pawns.

Book selectivity

The minimum probability percentage to make an internal opening book move playable. Moves with lower probability will not be played. This option may be used to control the selectivity of the (internal) opening book: Higher selectivity means that only the most common moves will be played. Lower selectivity means that Deep Junior will occasionally select less frequent moves.

Threads

Sets the number of CPU cores (threads) that Deep Junior will utilize when thinking (up to 40 cores). The default is to use all available CPU cores. You may reduce this number in order not to utilize the full CPU resources of your computer.

Ponder

Controls whether the engine will think on the opponent's time. For obvious reasons, this feature has been disabled on engines running on the Pi..

MultiPV

Sets how many alternatives to find in analysis mode: If MultiPV is set to, e.g., 3, the engine analysis will suggest a best move, a 2nd best move and a 3rd best move. The default is to suggest a best move only.

Futility Pruning

in its pure form is implemented at the frontier nodes (depth == 1). It discards the moves that have no potential of raising alpha, which in turn requires some estimate of a potential value of a move. This is calculated by adding a futility margin (representing the largest conceivable positional gain) to the evaluation of the current position. If this does not exceed alpha then the futility pruning is triggered (which usually means setting a flag like f_prune = 1). In short futility pruning prunes nodes that are so bad that they most likely can not compete with the principal variation.




Understanding the UCI Protocol

It's quite simple really, but somewhat confusing at first. The UCI Protocl is explained here and it's definitely worth the 5 minutes it takes to read.
Had I done the same, I would have saved myself a lot of frustration :/

The most important 'gotcha' for me was to realise that you have to input all the moves. The engine analyses a position you feed it, anf rom that will only suggest the best move to make.

The GUI handles functions such a books...




Links

The Chess Programming Wiki is a repository of information about programming computers to play chess.

How to Develop a Chess Program for Dummies.