Happy Halloween 2020! The origins of this little chess engine date back to 16th October 2002 and it has just recently risen from the grave. It plays strictly on scholastic chess level in 1.0 version and demonstrates that often the way to win is not making really good moves, but just avoiding bad ones :)
Downloadable source code release archives created so far are all listed in release section.
In GitHub, the master
branch is strictly for README and pre-compiled
binaries.
Code is in branches named X.Y-branch
and releases are created from
suitable tags, e.g. for 1.0 there is 1.0-branch
where there is 1.0
tag
from which source code release is created -- and when there is bugfix release
in 1.0
then there will be tag like 1.0.1
created on the same branch.
This is a basic chess engine (in C) that is able to play game from console and
via CECP (XBoard) protocol. It should perform on the level suitable mostly
for scholastic chess -- always looking only 4 plys ahead and without extensions
it can be beaten in the opening, middle game and end-game :). It supports
randomization (e.g. CECP random
that is sent by default when new game
starts) for varying play.
It is monstrous only so far as it has risen from the grave, not with regard to its monstrous playing "quality". Its origins date back to 16th October 2002 when I started writing it -- however it was thrown out after about a half-month of messing with it as my C-code ran into obscure crashes and memory errors that I was not able to trace back at the time. I was reminded of that program by a friend and I managed to locate its source code and went in to make a "quick bug fix". First errors I truly located easily with better tools of 2020, but one mysterious crash took long to track down and then I was already hooked in trying to make "simple" fixes to the program, which contained pretty much every error and oversight that can occur when writing chess engine from scratch:
So all in all much more time was spent on this than planned :), and now the Monchester is unleashed upon the world.
If used from console, new
command starts new game, resign
resigns and
moves must be entered in full algebraic coordinates, e.g. e2e4
, promotions
must be denoted by following lowercase letter, e.g. e7e8q
.
If used as engine via CECP (XBoard) protocol, the standard engine installation
procedures should apply. Or to set active engine from the command line, specify
the first chess program location, e.g. for XBoard, with Monchester binary
located in current folder: xboard -fcp ./monchester
.
The program should compile under Linux and Mac OS X and has been reported to
compile under Windows using MSYS2. Precondition is
presence of make
and gcc
C-compiler or compatible compiler symlinked
as gcc
(clang) -- in all my computers clang produces MUCH faster binary
than gcc
. Compiler can also be changed by passing make CC=some_compiler
argument to make.
make CC=clang clean release
gcc
make clean release
make
if there are no old files to cleanSince reading around, I get a feel that every chess engine must have a long list of features, so here I present a long list of non-features:
This engine does not use, feature or support: Alpha-Beta, Attack Tables, Bitboards (rotated, magic, black magic or any other kind), Iterative Deepening, Null-Move Heuristics / Pruning, Hash Tables, Late Move Reductions, MVV-LVA, Neural Networks, Opening Books, ProbCut, Razoring, Static Exchange Evaluation, Texel Tuning, Threads, Tablebases, Transposition Tables, UCI and many other things that I have either forgotten or never known :)
In features.h
there is a list of toggleable features with user-visible effects
that can be toggled or configured at compile time. Currently there are just two,
these are both off (and probably should remain off for casual user).
FEATURE_KEEP_ALL_PVS
(OFF)
Causes engine to remember PVs for all move branches and is mostly useful for engine
debugging and development. If this and FEATURE_KEEP_GAMESCORES
are both ON, then
written gamescores will include PV variations in gamescore PGN.
FEATURE_KEEP_GAMESCORES
(OFF)
Causes engine to write finished game scores to file .monchester.pgn
in user's home
folder. It is not generally very useful, as CECP and adapter interfaces for CECP
provide their own game score keeping facilities. This feature also uses flock()
file locking call that is not available on Windows, so enabling it should only be
done if wanting to do some development or testing on Mac/Linux or other compatible
systems.
Randomization of play can be disabled by defining:
DISABLE_SCORE_RANDOMIZATION
at build time, e.g.
make EXTFLAGS="-DDISABLE_SCORE_RANDOMIZATION"
but this is not recommended, as non-deterministic play actually gives Monchester much better chances in converting totally won endgames with major pieces, that it otherwise would draw with deterministic play.
There are couple more possible defines, those interested can probably easily find out their purpose:
SCORE_RANDOM_BITS
EXTRA_VERSION
This engine would not have been reanimated, if it weren't for XBoard CECP protocol implementation, a GNU project currently managed by Harm Geert Muller.
For game related bug-squashing, following engines proved to be nice sparring partners, as they are relatively stable, relatively beatable and relativily compileable: