Introduction To PicoChess V3
Introduction To PicoChess V3
As Millennium just announced the development of a "next generation" chess computer in cooperation
with Ruud Martin (really looking forward to that) I take the opportunity to write about my ongoing
project of building my own dream chess computer…
Although I really enjoy my "limited edition" DGTPi & Bluetooth eBoard chess computer based on a
Raspberry Pi 3B+ with PicoChess2.01 there are still some things which bother(ed) me almost from the
beginning.
So, I started to work on my dream chess computer "project" with the following work in progress result:
;-)
Hardware Upgrade
I "exchanged" my DGTPi & DGT Bluetooth eBoard with a used Revelation II Anniversary Edition and a
pure Raspberry Pi4 for running Picochess. Well, not really exchanged because I kept my DGT eBoard and
DGTPi as kind of my "mobile" chess computer solution ;-)
The reason for buying a used Revelation II was originally to have LEDs on the board to see the computer
moves immediately and more easily.
But honestly: after some time playing with my Revelation, I think that the LEDs are really not that
necessary for me - especially when they are so bright like in the Revelation II and cannot be dimmed, but
that is a different story.
I really enjoy the emulations of old dedicated chess computer on the Revelation - Ruud Martin has done
a great job with the integration of these chess computers emulations in the Revelation.
I seldom use the native engines instead I use of cause PicoChess in the Bluetooth mode of the
Revelation II.
Together with the Revelation II and newest firmware the system really behaves like a DGTPi - maybe
with a slight delay in responsiveness - but that is fine.
Beside of the board LEDs the Revelation has another really big advantage regarding Picochess: In
Bluetooth mode it emulates the DGT 3000 clock perfectly - oh wait not perfectly even better because on
the Revelation you can read all display output way better than on the DGT 3000 or DGTPi because it is
not restricted to the difficult to read "segment" based clock display.
The Raspberry Pi
I have put my Raspberry Pi 4 into an "open case" with lots of heat sinks so that it fits perfectly under the
Revelation.
Only the speaker does not fit under the Revelation, so it stays outside behind the computer.
Software Update
Ok, that is already a good starting point for my dream chess computer.
Based on this hardware PicoChess already comes very close to my dream chess computer.
PicoChess software related things which always ran through my head since the very first time I owned
my DGTPi were:
• (Semi-) automatic replay & analysis of the (last) game: not possible at the moment
• Taking back moves: no display of next move to be taken back
• Saved game times of the last played and continued game: still missing
• In case no external loudspeaker is connected to the Raspberry Pi it would be great to have at least
the moves announced in the web server: sadly missing (it is not so easy to do this for all mobile
devices)
• A fun famous game play option (guess next move of a loaded PGN game) like proposed by DJ in one
of the threads: also missing
• New time modes: tournament and search depth missing
• Chess-Tutor function during the game: hints for bad/good moves automatically during the game or
on request
• Kind of an opening explorer: showing the current opening for learning purpose Replay of games
with audio comments(!) for learning purpose
• Remote Engines: current solution in V.09N (and V2.01) is too complicated and is kind of exclusive
only: you either have to boot PicoChess in "remote engine mode" (with all engines coming from
your server computer) or in standard "local mode" (all engines coming from locally installed
PicoChess engine directory: Why is that? I would like to have some of my special engines (e.g.,
Giraffe - first NN engine developed by Matthew Lai and "an engine that must die so AlphaZero could
live" or Colossus by Martin Bryant) also on my DGTPi with having the need to reboot or use a PC
chess GUIs as a frontend
• MAME emulated chess engines: I already use the chess engines (which I own as physical chess
computer) emulated by the emulator MAME/MESS since more than a year on my PC since Sandro
Ronco created an UCI wrapper with the help of Lua-scripts. MAME definitely runs on a Raspberry Pi
and so it should be possible to use these in engines in PicoChess as well: unfortunately missing and
would be almost a unique feature for a chess computer (I know that the Mysticum Do-It-Yourself
computer or Certabo software is already capable of integrating MAME chess engines but it is based
on windows so they can use existing windows MAME chess engine implementations
Remark: in the meantime, Al was so kind to publish my MAME chess engine adaption for PicoChess and
compiles new versions of MAME for the Raspbian OS platform, thank you for that, Al!)
• Online Chess: As I have mentioned before I do not think that the DGT Board with PicoChess is the
ideal combination for online play (even with the LEDs although this makes it a little bit more
practical). But nevertheless, this is an often-requested feature and of course in theory should
possible and would be definitely a unique chess computer feature. But: PicoChess main advantage is
the easy setup and "switch it on and off you go" philosophy. It would be not so easy to integrate
online playing without destroying this easy handling especially as PicoChess is not designed at all to
manage server requests/answers and adjust the time management accordingly during game play.
For this we would need a good concept that is still "Picochess-like" easy but allows almost all online
configuration options.
• Favorite Engines: Now that we have so many engines (thanks to Al's great compilation work) it is
getting really difficult to just select the favorite engines. A separate engine list with just one's
favorite engines would be helpful (at least for me ;-)
After having described the hardware I use for my dream chess computer and enjoying the Revelation II
connected to a RPI4 as much as my "mobile" solution, a DGT Bluetooth board connected to a DGTPI, I
will describe some of the enhancements and new features of my new software version: PicoChess
Version 3.
As you might know as "official" PicoChess development stopped and nobody else tried to continue this
work (except for Al who still is looking for new engines & is compiling them for us - big thanks to him!) I
have learned the basic python things in order to add some of my most wanted missing features like
"premove" handling and an analysis mode where I can just put the pieces where I want to and PicoChess
starts thinking nevertheless if it is a valid move or not, voice comments, etc., all part of my V2.01
version.
For 1.5 years I am still adding smaller and bigger enhancement to my PicoChess version and before I will
close the PicoChess development chapter for me I think it is time to write about these things and some
of the features I am working on at the moment. Hopefully, I can finish most of the open topics soon (Al
and Wilhelm are already testing - big thanks to them and I appreciate your patience as they really get a
new version almost every week or so …)
Keep in mind that all these things might not be your cup of tea: if you just want to play against an engine
you can just use the existing versions of Picochess, that is fine. They do work well.
I will start with the feature I am working on right now at the moment (besides others):
PicoChess position correction messages
In case you knock of some pieces and cannot remember where to put them back or if you get the "set
pieces" message and cannot explain what is wrong and you have no Webserver access (in this case you
could just open it, sync the position and check) PicoChess now can give position correction messages via
the clock display and (lot of work) via voice announcements:
https://www.dropbox.com/s/i21fxhdfpg2q2lp/pico_pos_direction.mov?dl=0
The way this works is as follows:
If a "set pieces" is thrown a second time I compare the current board position with the internal board
position of PicoChess square by square and if there is a difference a message is displayed/announced in
order to correct this.
If the internal board position is the starting position, PicoChess will not give (in this case annoying)
correction messages ;-)
That is all - I was really missing this feature because I often have no WLAN and Webserver access (when I
am not at home with by board and DGTPi etc.) and sometimes I could not resolve the "set pieces" issue.
Next feature is also very basic - but I think important one: move information when taking back:
Taking back moves: Now the next move which could be taken back is shown in the display and in long
notation format (good for old people like me ;-)
Example:
After
And so on…
For better integration of the MAME emulation engines, I even enhanced the take back function in case
of a blunder move.
Normally you cannot take back moves when playing against a MAME engine but for me as a beginner I
often played a blunder move and then the game effectively over and lost (no chance to take back the
move).
Now when a blunder move is detected, and you play against a MAME engine an automatic take back
mode is triggered so that you can take back (only!) the very last (half) move before the move you played
is send to the engine (that would normally happen):
I have added new time-control settings:
Of course, the engine must support this feature via the UCI commands otherwise it will not work as
usual ;-)
If the number of n moves is reached PicoChess checks the corresponding player times and will announce
the result.
https://www.dropbox.com/s/q9z02km4mcnyvrk/TournamentTimeControl.mov?dl=0
So there are the following possibilities to specify time control (plus the max. search depth & "simulated"
median move time, see below):
# Examples:
# Tournament time control settings: n moves in g1 minutes (plus I increment seconds) and rest
# time = ...
['10 10 0 5', '20 15 0 15', '30 40 0 15', '40 120 0 90', '40 60 15 30', '40 60 30 30', '40 90 30 30', '40 90 15
60', '40 90 30 60']
**************
* Important: *
**************
For this feature a python-chess bug in 22.1 version must have been fixed to support the movestogo go
command option correctly (in later python-chess versions this has been already fixed! So, we definitely
have to upgrade the python-chess package some time!)
In file /usr/local/lib/python3.5/dist-packages/chess/uci.py:
changed to:
Support of a specific max. search depth (with an automatic setting of a fixed countdown movetime of
11:11)
Extract from picochess.ini:
## depth = search depth for each move calculation (if you want to restrict the move search to a number
of max. plies in the search tree, set a depth > 0. In this case the time control settings are ignored and
move time is set to 11:11, default for depth = 0
# depth = 0
depth = 0
c) New "simulated" median move time levels: 5s, 10s, 15s, 20s, 30s, 60s, 90s
This idea I got from the schachcomputer.info Forum - big thanks for that!)
The standard move times are a fixed number of seconds and an UCI engine will/should consider them
exactly.
To allow a more flexible, "median" move time options with i seconds we could define a game time of 0
minutes and a Fischer increment of i seconds:
Then the engine does have at least i seconds per move but does not need to take the whole "move"
time (then this saved time could be spent on more complex positions as this time is simply added to the
next "move" time)
Furthermore, we have to change that when the game time runs out of time that no "end of game" event
is triggered as we want to use this as a simulated median move time.
The new median move times are part of the Fischer settings like 0 5, 0 15, 0 20, …
As you can see from length of the new tournament time control settings: This will be displayed only on a
DGTPi or Revelation 2 correctly with all characters...
Practical support of remote engines and local engines at the same time
With PicoChess (0.9N, 201) it is already possible to run remote engines in PicoChess remote only mode
(you have to start PicoChess in this mode). Furthermore, you need a dedicated engines.ini on your
remote computer and you have only access to these remote engines in this mode.
I wanted to be able to access remote engines in parallel to my local engines without having to restart
PicoChess or switching anything at all.
With PicoChess 3.0 this is now possible:
Here you can see a MAME emulation of an old chess computer staring remotely from PicoChess on my
MacBook (all triggered from standard PicoChess mode):
https://www.dropbox.com/s/8pcumbz8q4welbg/MESS_REMOTE.mov?dl=0
- implemented via standard SSH connection, just add the remote login infos in the corresponding
parameters of picochess.ini and make sure SSH server is running on your computer (default on Unix and
MacOS, for windows you have to make sure that a SSH server is running I think)
[remote_stkf9]
small = Stkf9
medium = Stkf9
large = Stockfsh(R)
elo = 1500
levels = 8
ponder/brain = n
[remote_giraffe]
small = girf
medium = Giraffe
large = Giraffe(R)
elo = 1500
levels = 8
ponder/brain = n
[remote_colossus]
small = colos
medium = Colossus
large = Colossus(R)
elo = 1500
levels = 8
ponder/brain = n
Thanks to the help in this PicoChess forum I could add a special handling for connecting to a windows
SSH server (a modification in one of the SSH packages was necessary)
### =========================
## Path to the remote engine - good chances you do not need them ;-)
engine-remote-server = 192.168.178.34
engine-remote-user = molli
engine-remote-pass = XXXXXX
# engine-remote-key = your_secret_key
## The home path (where the engines live) for the remote-engine-server
engine-remote-home = /Users/molli/Documents/remote_engines
Better support for MAME emulated chess engines
I really like playing against my old chess computers from the 80s & 90s.
The emulator MAME/MESS (Multi Arcade Machine Emulator / Multi Emulator Super System) can be
used to run some of the old, dedicated chess computers by software emulation in PicoChess (you MUST
own these machines or the right to play them and have access to their ROMs or you can use some of the
free available ROMs from Ed Schröders web site).
Besides of the emulator itself plugins must be installed which will provide a UCI encapsulation so that
PicoChess can use these machines as a standard UCI engines and specific shell scripts starting the
engines needed (it took me a long time to figure out the right call parameters so that MAME runs with
PicoChess without a GUI).
Compilation time of the first MAME version took almost 48 hours(!) on myRPI3b+ on Stretch but
thankfully Al the "compile wizard" did this on his turboRPI4 now for us, see his MAME for PicoChess
thread:
https://groups.google.com/g/picochess/c/v_yRzCgxTI8
I have added several small enhancements for a better integration of MAME engines in v3:
- longer PicoChess startup time for MAME engines necessary because of voice/sound messages from
MAME engines
- "engine setup" message because of longer initializing phase of MAME chess engines so that one knows
that engine is still initializing (also useful for other engines which take that long like lc0 or NNUE engines)
- pico time control setting in UCI settings for setting a specific pico time control corresponding to the
MAME levels automatically (just set UCI parameter PicoTimeControl X Y Z in your UCI level settings) and
the time setting that were used before is automatically restored when switching back to a non-MAME
engine so that one can keep the "standard" personal time setting)
- adding (more or less) funny text comments to the "Boris" and "Sargon" engines. This feature can also
be used for other engines as well via the new PicoTutor.
Example: emulation of my old wooden chess computer Boris from 1978
"Boris plays black or white or even both and usually Boris plays better" ;-)
Sure - it is!
I forgot to mention the take back possibility of blunder moves which normally would not be possible for
MAME engines... (that is pretty handy for me )
As you might know, for MAME engines there is no opening book possible and normally must be
deactivated by choosing the 'no book' option.
With V3 a chosen book is automatically ignored when using a MAME engine - very handy.
Small enhancements of the Pico Webserver
Synthesized voice support for moves in Webserver and deletion of the non-working remote room
button functionality (we can still use the remote mode function in PicoChess - from my 2.0 version on-
and of course the remote engines as well)
Unfortunately, the speech output is only working in desktop browsers and in Android Firefox browser
(at the time I was testing it) - the other browser like chrome or safari do not allow automatic sound to
play on mobile devices - this normally absolutely makes sense.
Big thanks to Martin (author of the ingenious Turochamp python engine & old historic engine project,
see his Github repository) for helping me out on both topics!
Being a beginner in chess I always wanted to have kind of a chess tutor when playing with PicoChess and
this tutor should be independent
of the chosen engine because there are engines does not even support score & hint moves via the UCI
interface (like all the MAME engines and some "normal" UCI engines).
Of course, the display possibilities are very restricted so the current score and move hint function for
"normal" engines is already very nice which I often used.
But I always have to press buttons and for move hint only the best move is shown and not some
alternatives.
I wanted to have something similar but different ;-) with the following 4 functionalities (and for all
settings it should be possible to switch them on/off individually via the menu (which meant a lot of
work!):
- PicoWatcher
- PicoCoach
- PicoOpeningExplorer
- PicoComment
a) Pico Watcher
PicoWatcher checks your moves and returns annotations like ??, ?, !?, ?!, !, !!
For this is tutor engine like Stockfish (or another engine) runs in background and will calculate up to 20
moves deep in order to evaluate your moves and the position).
Here PicoWatcher gives a warning regarding the Fool's Mate:
The determination of the annotations ??, ?, !?, ?!, !, !! is very loosely based on a mathematical
framework I found here:
You can modify the parameters which will determine the check result by editing the file
"picotutor_constants.py" in the main /opt/picochess directory,
DUBIOUS_TH = 0.3 ## ?!
INTERESTING_TH = 0.3 ## !?
You can look at the files picotutor.py and picotutor_constants.py how this works in detail and change
the parameters for your belongings.
b) Pico Coach
The PicoCoach will give the position score and (eventually, more than one) move hint(s).
Activation of the PicoCoach during game play without pressing any button:
Just lift a piece from the board when it is your turn and put it back before the 'set pieces' message
appears (otherwise nothing will happen).
The evaluation and one or more hint moves will be given…
https://www.dropbox.com/s/arids3g5uz1o52n/PicoCoach.mov?dl=0
(In the meantime, the PicoTutor no longer speaks with a forked tongue (mixed voices) but always with
the same tutor voice ;-)
c) Pico Explorer
Display of the current book opening name(s) during game play and PicoExplorer will provide this
information and ECO code for my enhanced PGN output.
Opening information is stored in the database like text files "opening_name_fen.txt" (this one is based
on move sequence) and "chess-eco_pos.txt" (based on fen positions) in the main /opt/picochess
directory.
https://www.dropbox.com/s/ypfglift2tqpbsg/Opening_explorer.mov?dl=0
d) Pico Comment
Written game comments and more a less fun joke which I have implemented with regard to the MAME
engines Boris & Sargon which also display game comments ;-)
You can define engine specific game comments or one overall comment file…
https://www.dropbox.com/s/peowa90bitcplwj/PicoMEss_borisDpl.mov?dl=0
Important:
You might have noticed that almost all (or at least many) of the new features do need a 11-character
display - so users who do not have a DGTPi or a DIY DGTPi or a Revelation2 will have problems to use
these features. Obviously, best display for PicoChess is a Revalation2 because all characters can be
displayed like they should be (but I still like the old "retro" kind of display of the DGTPI) - but that is how
(software) life is: At some point in time, it is time to cut ties with the old…at least in my personal v3
version (sorry to XL clock users and user with normal connection to a DGT3000).
Do not know if any other Revelation II PicoChess users besides Al (greetings to you!) are reading my
thread but I finally figured out how to control the LEDs on the Revelation II.
I added this the LED activation to my take back enhancement (showing the next move -in long notation-
to be taken back on the display):
Move g6 to be taken back:
Furthermore, I wrote a little routine to just flash one square instead of two so that now the square for
the pico directions in order to set up a correct position is displayed on the board as well:
Here the white bishop must be put on f1:
Smaller V3 enhancements
Beside of the bigger enhancements I also did a lot of minor tweaks to PicoChess V3:
• Specific new set pieces sound (no voice) so you hear it when something is wrong with the board
position (you can hear this in several of my views where you see a “set pieces” message).
• Set opponent PGN player to 'Player B' instead of the engine name and user name to 'Player A' in
case of 'Observe Mode'
• No more searchmoves in UCI 'go' command for the engine in case of normal moves (important
exception: forcing an alternative move). Otherwise, we might get problems with the use of internal
engine books etc. (thanks to Rasmus - author of the nice CT800 chess engine - for the hint in the
schachcomputer.info forum)
• Bug Fix for Buster/Raspbian OS: Change of voice volume so it is working again (big thanks to
Wilhelm!)
• Small enhancements of REV2 and Webserver display of moves/evaluation/depth/score according to
the DGTPi display
• The PGN location can now be set to a fixed location in picochess.ini (in case you always got a wrong
one in your PGN files). Override of the PGN location from picochess.ini in case the parameter
'location' is set to something different than 'auto':
• Extract from my picochess.ini:
## Override PGN location from picochess.ini in case the parameter 'location' is set to something
different than default
## value 'auto' (you can use this if you always get wrong auto location)
# location = auto
location = Hamburg
• Removed use of ogg-vorbis player in picotalker.py because of audio play conflicts with sound from
MAME chess engines and OS update problems and missing start/stop/pause functions. Now
pygame.mixer is used instead, see https://www.pygame.org/docs/ref/mixer.html. Installation of an
additional lib via: "sudo apt-get install python3-pygame"
** NOTE: pygame is no longer being used for audio. It is now SoX. ** [Randy]
It seems to be a small enhancement but for me it is a really nice and important one:
After PicoChess starts up and new game events the current chosen engine is shown in the display
(setting in display menu & config parameter in picochess.ini)
(You can see this in several of my Dropbox videos I have posted). I always forget which engine I had
chosen at last - so this is very handy for me.
With this setting after startup or staring a new game you will see the engine name instead of the clock
starting times:
(Here you see Giraffe as remote engine - the very first NN engine prototype by one of the Alpha Zero co-
developer)
Enhancement of supported tags in PGN file
New tags are written into the PGN file of your saved games: opening eco code, pico remaining times,
pico time control setting
Example:
Support for correct remaining game times for continued games (finally;-)
The tag enhancement for the saved PGN game file allows me to set the correct remaining times on both
clocks.
(But I do not use this feature anymore because there is - at least for me - a better solution to all that
PGN save & continue solution, more on that eventually later)
Example:
[Site "Hamburg"]
[Date "2019.08.02"]
[Round "?"]
[White "Molli"]
[Result "*"]
[Time "11:44:41"]
[WhiteElo "1300"]
[BlackElo "1500"]
[PicoDepth "0"]
[PicoRemTimeW "280"]
[PicoRemTimeB "290"]
[ECO "B10o"]
1. e4 c6 *
Before reading/continuing the last saved game:
Restoring the last game:
Remaining times restored:
Display of "new position" message in case of flexible ponder (I always use that) analysis mode and the
user sets up a new position instead of playing a legal move.
This mode is the best analysis mode I can think of: Just set up a position and play (even illegal) moves or
set up positions without pressing a single button (unless you have to switch sides: just press the lever)
and you always see the current evaluation and hint move.
If one needs exact castling rights etc. then you could still scan the position with the "position" function
and enter the information.
I can now organize my engines in subfolders within the main engine folder (just specify the subfolder
path in engines.ini in in front of the filename e.g. [MAME/mm5] where MAME is a subfolder within the
armv7l folder (thanks to Wilhelm for supporting the correct engine startup loading procedure because
this did not work correctly in the previous PicoChess versions!). Now the whole engine path is
(automatically) written to picochess.ini.
Example:
I have separate folders for "NNUE" engines with their nets, "extra", "mame" (for the emulated chess
machines), "remote_UCI " for UCI files of the remote engines and "script" for python engines like
TURING, Bernstein etc.
New "favorite engines" options
It is a "nice to have" all 60 and more engines Installed but it is a pain to select one out of these many
engines...
=> new Favorite menu to keep your main and most often used engine separately.
just put your favorite engines into the favorite.ini file like you would do for the main engine list in
engine.ini and put it in the correct engine directory - that is it
Possibility to directly play an alternative move on the board after the engine move is displayed in
NORMAL mode like in TRAINING mode or in the DGT CENTAUR chess computer (setting in menu and
config parameter)
Menu for saving, reading and continuing a game from PGN files (yes, finally!)
I have implemented a very simple and easy way to save and restore games (due to the fact that I do not
know that much about the python file handling).
You can save up to 3 games at any time during a game play and load these 3 saved games or the last
played game (which is always saved automatically when there is a "Game Ends" event) later at any point
in time in order to continue it (this is not a replay feature - just a possibility to continue a game later).
After reading a game you can continue playing it by setting up the correct position with the help of the
Webserver (open the Webserver page and press the sync button) or with my just added new feature
"pico position correction messages" via the clock display (this is really cool when you do not have your
DGTPi connected to a WLAN).
For a complete game replay from the beginning to the end with simple analysis possibility there is a
different way in my v3 version…. (more on that eventually later when there is interest in this feature).
During game play just enter the new Game Setup menu:
Choose the "Save Game" option…
Choose one the three possible game slots Game 1, Game 2 & Game 3:
That is it.
Games are saved into the /opt/picochess/game folder:
In order to continue the game later just enter the Game Setup menu again and select the "Read Game"
option.
Choose one of the four possible game slots: last game, game 1, game 2, game 3 & game 4:
The corresponding PGN file is loaded and you can either use the Webserver in your browser… or use
directly the new pico position direction via the clock display….
or use directly the new pico position direction via the clock display….
Remark:
As you can see: at the moment the last used engine is not automatically saved/restored.
[Site "Hamburg"]
[Date "2020.10.01"]
[Round "?"]
[White "Molli"]
[Result "*"]
[Time "23:33:43"]
[WhiteElo "1300"]
[BlackElo "1465"]
[PicoDepth "0"]
[PicoTimeControl "1"]
[PicoRemTimeW "1"]
[PicoRemTimeB "1"]
[PicoOpeningBook ""]
[ECO "A09a"]
1. Nf3 d5 2. c4 Nf6 3. Nc3 Nc6 4. d4 dxc4 5. Bg5 Bg4 6. e3 Bxf3 7. Qxf3 Na5 8.
b4 h6 9. Bxf6 Qd7 10. bxa5 exf6 11. Bxc4 O-O-O 12. O-O Bd6 13. Bxf7 Qxf7 *
I am one of the people who like playing against the old chess computers (I still own a few of them).
I could further improve the integration of MAME chess engines besides of the features mentioned above
like automatic ignoring of the opening books, setting the pico time controls via UCI settings in addition
to the engine level or the automatic take back functionality.
Take for example the Chess Champion MKII
1. Last move of a game is now sent to the engine so that one can hear the voice resignment or sad
melody in case of a musical very gifted computer like the Commodore Chessmate or Novag Chess
Champion MKII.
https://www.dropbox.com/s/uwqfvvkw4i1690c/MAME_mate.mov?dl=0
(before mating I played a blunder to demonstrate the enhanced automatic take back for MAME engines)
2. In case the MAME chess engine resigns via voice announcement (like Fidelity’s Voice Chess
Challenger) you can now end the game by putting the kings within the 4 middle squares and starting a
new game by NOT putting the pieces immediately in start position but reloading the engine and then
putting the pieces back in start position. This was not possible before, see this thread from Henri:
https://groups.google.com/g/picochess/c/aw10c-D3T30
It is important that we first reload the engine before putting the games into start position because the
only way to reset from this situation (besides the restarting of the whole system of course) is to kill the
engine and reloading them.
Until now I have introduced my "dream chess computer project" consisting of a PI4 with loudspeaker
connected to an (used;-) Revelation 2 and my mobile DGTPi with a PI3b+ inside connected to a DGT
Bluetooth eBoard and a powerbank as well as my core software development: PicoChess V3.
You can read more about the hardware in this thread: https://groups.google.com/g/picochess/c/jC-
EEwEd15M and more about my PicoChess V3 software in this thread
https://groups.google.com/g/picochess/c/HM2Dtzt6gic.
In this new thread I will describe a concept I have implemented for my V3 which would allow a more or
less easy integration of otherwise very complex new functionality which would normally need a lot of
changes in PicoChess especially for the menu (new options) and in the event control mechanism in order
to process the new functionality.
Although in the meantime I now know how to add new menu items/options and how to change/add
new events in Picochess, there are some use cases where this really intensive UI and event changing
work even would not be sufficient because the restricted input possibilities of the clock and a really big
change in the code design of Picochess.
Overall PicoChess was and is in the first designed in order to just choose an engine and play against it
and this is done in a very -from my point of view- nice and easy way making the playing experience really
enjoyable for me.
That is why it is not so easy to add new more complex functions which do not behave like a normal UCI
engine: I am thinking for example of the possibility of replaying a game for- and backward, eventually
getting a simple analysis for each move or a "guessing the next move" option for famous games like DJ
suggested in this "famous mode" thread:
https://groups.google.com/g/picochess/c/TGNBnSIBKF4/m/q6fgIwOhAAAJ or the integration of an
online server for playing online games (regardless whether these functions really make so much sense
within PicoChess or should be better done on the PC).
Because of these current enhancement "restrictions" and my restricted python programming abilities
and I found a way for me to add such new functionalities without too much redesign effort in my V3.
My idea is to add a complete new complex functionality which behaves or could behave like an engine
via an "enhanced-UCI engine" consisting of…
a) a UCI-wrapper around the "engine" part of the new functionality -> by this we get all possible settings
automatically presented in the engine level menu of the clock!
b) eventually a small text file for exchanging additional communication information between the engine
and PicoChess (only when it is not possible via the standard UCI protocol)
An additional advantage of this approach is that in case the user wants to add more personalized own
options the user could just edit the UCI text file for the enhanced UCI engine in the same way as the
level settings for the engines in PicoChess. The new options are immediately displayed in the engines
options menu - all for free.
Downside is the performance: communication with an "wrapped" UCI engine and processing an extra
"communication" file is of course much slower than a direct implementation within the PicoChess event
handling.
For a "PGN engine" (see below) this is not much of an issue but for playing online games where the pico
and server time shave to be in sync that is unfortunately a bigger issue.
So, this is definitely not a perfect or even good way to add new features to PicoChess but for me it was
at least one possibility which I was able to implement (for an official PicoChess development source
branch I would not recommend this approach - another reason for this my personal PicoChess version ;-
).
Although I think that this feature is not that important for PicoChess (because it could be done in a
much better way on the PC) I had particular use case for this.
It all started with a really cool (German) radio play: "Nahrungsmittel während der Zeitnotphase" by
Helmut Krausser broadcasted in the German radio in 2005 playing in real time during the last game of a
chess tournament. Every time I was listening to the radio play, I thought it would be cool if I could "see"
that move sequence in parallel to the radio play.
https://de.chessbase.com/portals/3/files/2005/hoerspiel/nahrungsaufnahme.htm
The radio play itself I recorded at that time myself, but you can still find it online somewhere e.g.
https://radio.friendsofalan.de/hoerspiel-nahrungsaufnahme-waehrend-der-zeitnotphase-von-helmut-
krausser .
So, I wanted to be able to replay this game on my DGT Board while at the same time the radio play was
played, and all this done with PicoChess => That was the birth for my PGN engine.
Only some weeks ago I discovered that there has been already an analog version of this concept around
since the 1980:
With this computer you could replay a game on your TV screen and at the same time listen to audio
comments e.g., from the German grand master Helmut Pfleger.
There is an interesting interview with Frederic Friedel on Chessbase (The Origins of the Database with
Frederic Friedel: https://en.chessbase.com/post/the-origins-of-the-database-with-frederic-friedel) and
Hein Veldhuis published a short paper about this "database" machine, see:
http://www.schaakcomputers.nl/hein_v...prototype).pdf
Frederic Friedel with an intelligent chess prototype (picture taken from the video by Chessbase)
Nowadays this concept works also perfectly with free chess tutorials from YouTube which do not rely on
too intensive showing and playing variants on the screen. We can easily convert them into the .ogg file
format so that PicoChess can play these files.
For this I had to use a different sound system for PicoChess because I needed addition audio commands
(start/pause/continue/restart etc.).
I am now using pygame.mixer, the audio part of the pygame multimedia programming
library/framework:
** NOTE: pygame is no longer being used for audio. It is now SoX. ** [Randy]
I have implemented a PGN replay engine using the enhanced-UCI engine concept with the following
features for my V3:
• Replay of a saved or manually imported game without pressing a button (except from starting the
replay and moving the pieces hence semi-automatic) ;-)
• Going forward and backward by just playing the announced move or by taking back the last move(s)
which are now displayed on the clock
• Option to play an audio file in parallel (and being able to pause and continue it)
• Replay (or more or less) famous games with guessing the next move option
• Getting a small analysis by pressing the standard depth, score and hint buttons: you can specify the
analysis engine in the UCI settings of the PGN engine.
Replay of a saved game and a "guessing the move" game for famous games are now possible via my
PGN Replay engine
Semi-automatic replay of saved PGN games with hint move/score evaluation by an analysis engine for a
specific thinking period (time settings will be changed according to UCI file), access to the last saved
game, the predefined game slots 1-3 and the games.pgn file containing all games you played with
PicoChess (then PicoChess will select a game in the order you specify in the UCI settings: going up, going
down or by pure chance).
After loading the PGN engine with corresponding UCI settings for a specific game the PGN header data is
displayed.
To start the replay just press the lever and the first move will be shown. After moving the computer
move sides are automatically switches and the next PGN move is displayed and so on.
If you want to see a score and hint move - just press corresponding buttons on the clock like you would
do in a normal game.
The analysis engine and time settings are defined in the UCI file of the PGN engine.
With the standard takeback option, you can "scroll" backward and forward through the whole game (in
V3 even the next move to be taken back is displayed via clock displayed and LEDs will flash for the
Revelation owners) again (just press the lever to continue forward playing)
If you want to play against an engine at a specific point during the replay of the game: just choose the
engine via the clock menu and continue the game against the chosen engine.
https://www.dropbox.com/s/a8gigaie7z1wrtr/PGN_REPLAY_FOOL.mov?dl=0
Furthermore, an audio comment file for the PGN file can be specified and will be automatically played
during the PGN game replay and can be manually started and stopped during the match. Play & pause
the audio comment by just pressing the middle play/pause button of the clock (how logical is this? ;-)
https://www.dropbox.com/s/leb0io87ijhmd6b/PGN_Replay.mov?dl=0
"Guess that move" game option for famous games (for white or black)
Make your first guess (you can define how often you would like to guess until the correct move is shown
by Picochess)
If it is correct the next opponent move is played, if you guessed wrong PicoChess triggers an automatic
takeback mode (like for MAME engines), showing the move to be taken back. After you have taken back
the last move you can either guess a second time (in case you specified this) or PicoChess will play and
announce the correct move)
Additionally, the PGN replay guess mode can be used to train opening books when setting an empty
PGN file with name 'Book Test' and choosing a specific book which you want to train and guess
corresponding moves (e.g., create an opening book based on Magnus Carlson and guess what he would
play next)
Here I try to guess the next moves of Alick Glennie playing against Turings TUROCHAMP algorithm from
1952 (calculated and executed manually by Alan Turing himself):
https://www.dropbox.com/s/okglrfsyotchmwp/Guess_move_pgn.mov?dl=0
The algorithm has been ported to python as UCI engine by Martin (see
https://github.com/mdoege/PyTuroChamp) so you can play with PicoChess against it!
You can read more about this famous historic chess computer game online, e.g.:
https://www.chess.com/blog/Ginger_GM/the-history-of-computer-chess-part-2-turochamp
PGN Folder Structure
PGN engine UCI settings
I have hesitated to write about this topic for a long time, but I know that some of you guessed or even
knew that I was working on this topic as well. Although nothing has been really finished, I thought I just
give a status update of my experimental work as this topic belongs also to my enhanced UCI engine
concept. But do not expect too much - more on that struggling at the end.
Up to now we the following "remote features" in Picochess:
a) Remote engines - serving an UCI engine from a remote PC. This could be also a WB (Winboard)
instead of an UCI engine (together with a WB2UCI converter for Windows for example). Works in V3 in
parallel with the local PicoChess engines (see my post in Building my dream chess computer Part II: The
software "Picochess V3")
b) Remote mode (this mode still confuses some users because they do not know how this mode really
works while some think the mode does not work at all): by setting the mode to remote in the PicoChess
menu you can play against someone who is using the PicoChess Webserver. The server can be reached
via your local WLAN/LAN or with the corresponding router settings (port forwarding) via internet as
well. You execute your move on the eBoard and your remote opponent enters his moves via the virtual
chess board of the Webserver (this mode works again from my V1.0 on).
(This picture has been taken with PicoChess V2.01 where the useless "remote (room) button" has not
been removed in the Webserver page (i get rid of this button in my V3)
What is still missing is …
In the past I have stated multiple times that I do not think that PicoChess is the first choice when it
comes to online gaming.
Mainly because of the restricted clock UI, the missing board LEDs, the big effort to integrate such a
service within PicoChess because of the current structure and the slow "move input" process via the
board.
For me playing a Blitz or even Bullet game on my tablet is way more comfortable and enjoyable.
Furthermore, PicoChess lives from the fact that it is quite easy to use in every aspect I think I have tried
to follow this general rule in my V3 like the automatic takeback option in MAME or the PGN engine
when guessing moves or the tutor move hint by lifting up & setting down a piece etc.)
Online server integration means almost for sure that we lose some of these benefits with PicoChess
(when done wrong at least ;-) unless you just rely on an additional device where you do all the settings
and create challenges on the server's web site etc. My approach does not need an additional device
(although lichess offers a nice way to do this, see the manual seek option I have implemented).
But after experimenting some time now with online chess within PicoChess I must now revise my
opinion - at least in a few aspects:
• LEDs: not so important Although I now have a Revelation II with LEDs, I still like to play with my
Bluetooth eBoard together with my "limited edition" DGTPi and I do not miss the LEDs at all with
this setup and I can execute the engine's move using move voice announcements almost as fast as
on the Revelation II with LEDs.
• And of course, there is more than just bullet and blitz online gaming - playing a 15- or 30-minute
game with a friend online via the board can be a nice experience as well and makes fun like the blitz
games on the tablet.
• Regarding the effort to integrate an online gaming server into Picochess: now my "enhanced UCI -
engine concept" comes into play similar to my PGN engine (yes, you might have guessed it ;-) which
allows an integration of "online engines" with much less effort while at the same time the online
configurations fit nicely to the PicoChess UI: easy to use and not too complex (I will talk about the
disadvantages in a second)
Keep in mind that all the things you read in this post are not finished by any means - just basic
prototypes (no processing of game messages like resigning or draw offers, promotion of other pieces
than queen etc., and it is not yet tested at all) …
I started with the integration of the Free Internet Chess Server (FICS) because it was rather straight
forward to implement when you know the simple protocol via telnet.
First, I built an UCI wrapper around the FICS protocol so that it behaves (almost) like a normal UCI
engine. By this I got the menu entries for this service and possible options automatically presented in
the (engines) menu and game session specific settings can easily be defined in the UCI config file - great!
Next step was to add a basic "framework" to PicoChess that makes it possible to easily integrate online
engines meaning an extra logic for the "seeking" phase for finding an online opponent, showing this
information in case an opponent has been found and checking the game (end) status etc.
I started with the integration of the Free Internet Chess Server (FICS) because it was rather straight
forward to implement when you know the simple protocol via telnet.
First, I built an UCI wrapper around the FICS protocol so that it behaves (almost) like a normal UCI
engine. By this I got the menu entries for this service and possible options automatically presented in
the (engines) menu and game session specific settings can easily be defined in the UCI config file - great!
Next step was to add a basic "framework" to PicoChess that makes it possible to easily integrate online
engines meaning an extra logic for the "seeking" phase for finding an online opponent, showing this
information in case an opponent has been found and checking the game (end) status etc.
The result you can watch in the video I have already posted above:
The world's first played PicoChess Online Game played with Al...
https://www.dropbox.com/s/cew7v5hqakx4l2j/Worlds_First_online_MAtch_with_Al_via_Picochess.mo
v?dl=0
After a few more refinements I could play without pressing any button against different opponents -
here on my DGTPi which is really fun. Here is one of my very first PicoChess online video with excellent ;-
) live commentary by Dimitri Kamarov:
https://www.dropbox.com/s/ti3bhhtl8yav8el/Online_DGTPI.mov?dl=0
The "framework" of enhanced online UCI engines which I added to Picochess:
- Switch to Online Mode if online engine is chosen (engine name starts with Prefix 'Online') and
automatic login according to the logon-user settings in the UCI file.
- Time control settings are taken from the online server challenge and are automatically applied as
current time control settings in PicoChess (will be automatically reset to default time setting which you
can specify in the picochess.ini file when you choose a non-online engine)
- clock does not starts immediately after first move and online move is automatically played in case of
the online opponent plays white (automatic side switch!)
- Player's time already starts with announcement of best move and no longer when the computer move
has been done by the user (other than that no real sync with server time has been implemented)
- new online seek triggered in case of 'start new game' event (just replace the pieces in starting position
as usual)
- additional online info messages (login, seeking, opponent name, game result)
Here after seeking for a short time an online opponent is found and the opponents name is displayed
before the game starts
- the last user move of a game which leads to an end is pushed to the online engine in order to inform
the server (this is different when planning with normal engines)
- online player names in PGN file(s) instead of engine or pico username only
- Online engines will not be saved in picochess.ini as last engine (like the PGN engine) - makes no sense
in opinion
- Of course, all PicoTutor features like move suggestions or blunder warnings are switched off for online
play
Unfortunately, because of this framework the PicoChess code got very complex - that is a disadvantage
of my "enhanced UCI engine concept" compared to a direct integration of the online functionality.
The Prototype Online Engines
- very basic FICS (Free Internet Chess Server) Online engine (for this TELNET must have been installed,
do not know any more if it is already done by default or if I had to do it via "sudo apt-get install
telnet"?): faster integration than lichess, lots of seeking options, "listening" option (waiting until your
opponent challenges you)
Here you can see the "listening" option so that PicoChess (logged in twit user 'TheMeaningOfLife' waits
until someone (here myself under a different guest account) using best the web client for FICS I know:
Mobialia, https://chess.mobialia.com/#run
https://www.dropbox.com/s/r35ekx3a85huqkr/Online_listen.mov?dl=0
As I do not know that much about web development, I started by using a "python wrapper" library for
the lichess Board API (berserk) and applied an UCI wrapper around it for my enhanced UCI ((online)
engine framework - so we have a wrapper within a wrapper - no wonder that this approach is kind of
slow :-(
We can define basic seek challenges like for the FICS engine completely without any extra PC/tablet or
whatever.
But there is a cool possibility which is not possible with the FICS engine: the "manual seek" mode I have
implemented for the lichess engine:
Manual seek:
https://www.dropbox.com/s/hmw0x4v51xbmn75/pico_lichess_stf.mov?dl=0
b) one of many online bots (different engines which user put online as a bot)
https://www.dropbox.com/s/6dmaw47mq829p5g/lichess_bot.MOV?dl=0
c) search for an anonymous online opponent
Although these prototypes seem quite interesting there is a kind of showstopper why I paused the
current prototype development.
A really big problem is the synchronization of the server and PicoChess clock times caused by my
enhanced UCI framework solution (which I use for the prototypes) because it is an asynchronous
solution so that the design itself allows no correct synchronization of the times. PicoChess just waits in
its own event loop for the "best move" event and processing will be always a little behind the moment
the actual online server answered.
Furthermore, I tried to fix any sync time issues by modifying the PicoChess code further: meaning start
of the clock times should be not immediately with first move, the users time must already run when the
opponent move is announced, and I spend a new picochess.ini parameter in order to compensate any
time loses during the UCI communication.
But all that did help very much, especially not for the lichess engine as this is already the slowest one
because of the multiple wrapper layers.
Yes, I like playing online with PicoChess and my eBoards (and I did not expect that before) but only when
it is integrated within PicoChess in a nice, direct and simple way (like with my enhanced UCI -engine
concept ;-)
By having an additional device in order to open the server webpage and choose the opponent there is
also a nice approach (the manual seek option for lichess is really nice) - but only as an option.
Unfortunately, my solution also means that server integration is not so tight and fast and that there are
severe time synchronization issues that cannot be fully fixed.
• my online engines are not recommended for speed gaming like 5 or even less minutes per game (the
lichess Board API does not even allow faster games than 10 minutes)
• I would never play with my real user I use for "normal online" play when using the board with
PicoChess (hence I have created a new user eBoardPlayer user for this case)
• You cannot rely on the times PicoChess is showing because they will differ from the server times
(gap is getting bigger the longer you play (and can be currently more than 1 minute in the end!)
So, will I ever finish the prototypes so that one can play with these time sync issues and delays,
nevertheless? Hmmm - actually I do not know at the moment.
But unless someone takes the plunge and implements a more direct integration with less delay and sync
issues, I will leave my already existing "online framework" for these online engines in my V3 at least,
maybe I will find a good compromise solution and finish the prototypes someday…
This is the (probably incomplete) feature list of my V3 - actually I lost track of all the things I changed :-(
#####################################################################################
#######
#-------------------------------------------------------------------------------------------
#-------------------------------------------------------------------------------------------
# 4. New flexible ponder mode: no more checks if valid moves, position can
#-------------------------------------------------------------------------------------------
# various events
# 9. Continue directly after start with an interrupted game if board still shows
# 10. New cool training mode with training options (with big thanks to Wilhelm!!!)
# 12. Various bug fixes (e.g., pressing the outer buttons for quick restart
# instead of shutdown like it was intended, calc. error in evaluation)
# d5 EVAL.SCORE KIBITZ
# e5 OBSERVE OBSERVE
#-------------------------------------------------------------------------------------------
# 15. Added possibility to change voice volume via menu and picochess.ini
#-------------------------------------------------------------------------------------------
# I think most of the enhancements only make sense running on a Revelation II (or at least
# to read game comments or the opening name etc. while this is exhausting on a DGTPi and awful
# Some features (like tournament control or PicoTutor) even would not correctly work on stand
# alone clocks together with PicoChess because the display cannot show the correct time control
# setting.
# Furthermore, additional libraries must be installed, a bug must be fixed in the python-chess
# code itself(!) for the tournament control option and you need additional engines for some
# of the new feature (do not ask me where to get them or where you can get an image etc.)
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# !!! Keep in mind: I did these enhancements in this Personal Version for my own pleasure
# !!! in order to have fun & play with PicoChess on my Revelation 2 - so it might be not
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# - Switch to Online Mode if online engine is chosen (engine name starts with
# Prefix 'Online')
# - Time control settings are taken from the online server challenge and are
# - Clocks start after first white and black moves. After this the player's time already
# starts with the announcement of the best move and no longer when
# the computer move has been done by the user (other than that no real sync with server
# - Online decrement: In order to better "sync" PicoChess times with online server times
# you can subtract X seconds after each own move from your remaining game time in
# - additional online info messages (login, seeking, opponent name, game result)
# - Online move is automatically played in case of white = online opponent and clock starts
# - last move is published to online engine in case of game ending to inform the online
# server
# - online player names in PGN file(s) instead of engine or pico username only
# - picochess.ini "Online decrement" parameter can be overwritten in online UCI files via
parameter
# - still work in progress (do not ask me when they are ready to play...):
# - basic FICS online engine (for this TELNET must have been installed, default!?)
# - very basic lichess online engine (for this the BESERK package must have been installed, still in
early beta and not released yet)
# - longer startup time for MAME engines necessary, voice/sound end messages from MAME
engine
# last ending move is published to emulator engine in case of game end for specific engines
# - "engine setup" message because of longer initializing phase of MAME chess engines
# - support for pico timecontrol setting in UCI file settings according to MAME engine levels
# (just define the UCI parameter PicoTimeControl X Y Z in your level settings) and time is set
# - When switching back to non-MAME engine time settings are reset to last setting before it has
been
# eventually changed by the UCI setting (default time setting can be defined in picochess.ini
# via parameter def-timectrl when having a MAME engine as last engine after startup)
# - automatic reset of the original time control settings after choosing a non-MAME/MESS engine
# - MAME engine should not be saved as last used engine on a DGTPi because of possible clock
problems when
# starting MAME engine directly after boot (very strange maybe a sync problem with dgtpicom
lib!?)
# 19. Finally: practical support of remote engines and local engines at the same time(!)
# - IMPORTANT! For windows server access an update of the spur and paraminko packages and a
# modification of the spur package is necessary (ssh.py must be replaced from a different
repository)
# - implemented via standard SSH connection, just add the remote login infos
# and make sure SSH server is running on your remote computer (default on MacOS)
# 20. Automatic takeback mode (only for MAME engines) in case of a blunder move with active
PicoTutor (PicoWatcher must be switched on)
# - Normally taking back moves when using MAME engine is not possible so this is a nice feature
for
# - only the last blunder move can be taken back when using MAME (of course this restriction is
not
# 21. Bugfix: Set correct (old) engine (name) in case of engine error (very important for
# new remote/online engines which should easily fail if server is not available)
# 22. Taking back moves: Now the next move which could be taken back is shown in display and
# 23. After startup and new game events the current chosen engine is shown in the display
# 24. Support for correct remaining game times for continued games from version 2 (finally!)
# 25. Synthesized voice support for moves in Webserver (unfortunately works only in desktop
# browsers and in Android Firefox browser): Big thanks to Martin (author of the ingenious
# TuroChamp python engine) and deletion of the non-working remote room button functionality
# Of course, you can still use the remote play mode functionality (re)introduced since 2.0 and
# - Semi automatic replay of saved PGN games with hint move/score evaluation by an analysis
engine
# for a specific thinking period (time settings will be changed according to UCI file and changed
# back automatically)
# - "Guess that move" game option for white or black (switch "guessing" sides by pressing the
lever)
# - Additionally, this PGN replay mode can be used to train opening books when setting
# an empty PGN file with name 'Book Test' and choosing a specific book in menu: just try and
play
# a move you think belongs to the chosen book opening (makes more sense when you create
specific books
# - Furthermore, an audio comment file for the PGN file can be specified and will be automatically
# played during the PGN game replay and can be manually started and stopped during the match
# (I did this because I have a (German) genius radio play "Nahrungsaufnahme während der
Zeitnotphase"
# which is playing in real time during a tournament game. Now I can listen to the radio play and
# watch the game at the same time with PicoChess - how cool is that!?
# - PGN Replay engine settings will not be saved in picochess.ini as last engine
# 27. Enhancement of supported tags in PGN file: opening eco code, pico remaining times, pico time
# control setting
# 28. For online-, emulation- and pgn-mode: Automatically switch off opening books (setting "no
book"
# as book option)
# 29. Override PGN location from picochess.ini in case the parameter 'location' is set to
# something different than 'auto' (you can use this if you always get a wrong auto
# location).
# 30. Basic chess tutor functionality (even in case the chosen engine does not support
# score & hint moves like almost all MAME emulated engines) with the following 3
# a) Pico Watcher (checks your moves and returns ??, ?, !?, ?!, !, !!)
# You can change the control limits for the evaluations in file picotutor_constants.py
# b) Pico Coach (gives position score and move hint(s) - just lift a piece and put it back into
# c) Pico Opening Explorer (displays current opening name (alternative) independent of the
# Tournament time control settings: n moves in g1 minutes (plus I increment seconds) and rest
# time = ...
# **************
# * Important: *
# **************
# for this a python-chess bug in 22.1 version must have been fixed to support the
# If you have a higher python version look there (e.g. 3.7 on BUSTER)
# 32. Possibility to directly play an alternative move for the engine on the board after the engine
move
# has been displayed in NORMAL mode (like in TRAINING mode or the DGT CENTAUR chess
computer)
# 33. Menu for saving, reading and continuing a game from PGN files (yes, finally!)
# In order to load and continue a saved game you will need to use the Webserver in order to set
up
# the correct starting position of the game. For this you must open the Webserver page BEFORE
# you read and restore the game or if not just use the sync button!
# 35. New time control setting: Support of a specific max. search depth (with a fixed
# 36. Support of written game comments like it used to be in Boris or Sargon 2.5 MGS old chess
computers
# 37. Display of PGN event, players & result when loading an existing game
# 39. Display of "new position" message in case of analysis mode and user sets up
# a new position instead of playing a legal move (or in case he plays an illegal
# 40. Removed the use of vorbis ogg player because of audio play conflicts with sound from
# MAME chess engines in picotalker.py and OS update problems and missing start/stop/pause
# ** NOTE: pygame is no longer being used for audio. It is now SoX. ** [Randy]
# 50. Three new voices (one with commentary): Daniel (Eng.), Boris (Eng. with commentary)
# and Gust (German). Additinal voice samples (Eng./German) for the new PicoChess V3.0
# 51. Specific 'set pieces' sound (no voice) so you hear when something wrong with the board
position
# 52. Set opponent PGN player to 'Player B' instead of engine name and username or 'Player A'
# 53. No more searchmoves in UCI 'go' command for the engine in case normal moves (exception:
# Alternative moves), otherwise this might cause problems with the use of internal
# 54. BugFix for Buster: Change of voice volume working again (big thanks to Wilhelm!)
# 55. New (Fischer) "simulated" median move time levels: 5s, 10s, 15s, 20s, 30s, 60s, 90s
# (thanks to the schachcomputer.info Forum for this idea!)
# 56. New "favorite engines" options: It is nice to have all 60 and more engines installed
# => new Favorite menu to keep your main and most often used engine separately.
# just put your favorite engines into the favorite.ini file like you would do for the
# main engine list in engine.ini and put it in the correct engine directory - that is it
# 57. BugFix: Continue game/load saved game and play in opposite board direction fixed
# 58. Support of engine subfolders: you can now organize your engines in subfolders
# within the main engine folder (just specify the subfolder path in engines.ini in
# in front of the filename e.g. [MAME/mm5] where MAME is a subfolder within the armv7l
# folder (thanks to Wilhelm for supporting the correct engine startup loading procedure!)
# 59. Fix for the strange clock times reset "bug" when playing without a clock with just a board,
# Pi and the Webserver. With the voice move announcements of the Webserver in V3.0 we even
# do not have to look at the Webserver screen when playing... (thanks to Marcel Swidde for
# 60. Position correction message after the "Set pieces" error message occurs the second time:
# assuming that you are lost and do not know where to put the piece to its correct position,
# PicoChess will tell you what is wrong and how to correct (if you have your Pi hooked up
# into your WLAN you could just check the correct position with the Webserver board display
# PicoChess will stop the clocks and check its internal game position against the external
# DGT board position and will display two kind of correction messages:
# This will continue as long as the correct position has been set up.
#
#####################################################################################
#######
1. As there is no dedicated manual for my V3 version please read about the features in my above-
mentioned threads. I will just put my 3-part thread forum description into a pdf/ePub format, you will
find these (as well as all other documents) in the manual folder of the main PicoChess directory.
*** NOTE: the following description is based on the Dirk’s original image release of PicoChess v3. For a
description of what is included in my images, refer to the accompanying text files in the downloaded
archive. [Randy] ***
2. So what is in this image? The V3 image will be based on Marcels PicoChess 10 image (see
https://groups.google.com/g/picochess/c/hvBMzyGwKOA thanks to Marcel for this) which means you
have a Desktop OS and also a samba and VNC server preinstalled (Henri will like this ;-). I have tested the
VNC connection with the TigerVNC Viewer for Mac because the internal VNC client of macOS did not
work for that.
Bluetooth and WLAN are of course activated - you just have to set your home SSID and password. I
myself do this directly after I flashed the image to the SD card by copying my wpa_supplicant.conf file
with my win info into the main boot directory. The wpa_spplicant.conf file should look like this (for
Germany: DE as country)
country=DE
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="WLAN NAME"
psk="PASSWORT"
key_mgmt=WPA-PSK
3. Compressed image size is about 7,5 GB and uncompressed it will fit on a 16GB SD card. Unfortunately,
it will not fit on an 8GB card. Keep in mind that different manufacturers could have small differences in
SD card sizes so eventually you must use an even bigger card when you get a warning when trying to
write the image. As some of my enhanced UCI engines use a file transfer for communication the faster
the SD card the better.
4. I will test the images on a DGTPi with PI3B+ inside, on a standalone PI3 and PI4 all connected to a DGT
eBoard and the Revelation II.
5. The engines: Newest versions of all the standard engines including stockfish 12 (greetings to Peter ;-),
updated NNUE engines (again big thanks to Al), all historic engines from the paper engines of Alan
Turing and SOMA up to one of the first chess programs running on a real IBM computer Bernstein
(thanks to Martin, see https://github.com/mdoege/PyTuroChamp ). MAME is preinstalled, see below.
Some more python and Lua script engines like the original Sargon 1 program and my own engines: PGN
Replay and FICS Online engine (yes, I decided to include my FICS engine despite the time syncing issues.
The lichess engine has more problems and I need some help from some python experts I guess).
6. Voices: New voices for supporting all new V3 features (sorry only in German and English) but the new
feature samples are added to every English and German existing voice. Also, some voices with basic
commentary like GLaDOS (thanks to Jon in this forum!) or my BORIS or Dimitri voice (try Dimitri with a
quick online game - that is fun)
7. Regarding the DGTPi button and the two queens handling to switch off Picochess: This has slightly
changed so that standby mode with Bluetooth reconnection is possible: Pressing the button the first
time when PicoChess runs will shut down the Pi but the display stays on. Just wait until the computer
connection icon vanishes and press the button a second time to switch off the display. Now the DGTPi is
in standby mode. Pressing the button, a third time will start up the Pi again and Bluetooth connection
should be successful. So, you do not have to cut the power supply for a successful reboot and Bluetooth
reconnection.
8. Engine handling: engines.ini MUST consist of all existing engines. Your favorite engines of the
engines.ini should be defined additionally in favorites.ini. These will appear in a separate "Favorites"
menu to give faster access to you most used engines (I have created an example based on the engines of
this image). You cannot add or delete engines in the favorites menu via the clock buttons, you must edit
the favorites.ini file like an engine.ini file - sorry Henry ;-) I for myself just copy the most interesting
engines for me from engines.ini into favorites.ini - that is it
9. This image includes the most current MAME/MESS version 0225 and all needed libraries/packages,
engine scripts and UCI files for the emulated chess computers. You only have to put the ROMs of the
chess computers you own(!) into the corresponding ROMs directory of MAME installation: /opt/pico-
chess/engines/mame_emulation. ROMs must always match to the used MAME version - so if you have
problem with a ROM you are most probable using wrong version of the ROM which is not compatible to
the MAME version. The MAME engine UCI files consist of the emulated chess computer levels plus the
time control settings for PicoChess so that the PicoChess time will automatically set to the
corresponding level (thanks to Al for defining all these). After adding the ROMs, you must add the
corresponding engine.ini (and eventually, favorites.ini). I have included a engine_mame.ini from where
you can copy the necessary entries.
10. The new feature "position correction message" will be activated when the "set pieces" message
occurs a second time (not before this happens
11. Opening books are automatically ignored for MAME and online engines, all pico tutor features
(watcher, coach) will be switched off for online chess
12. The new tournament and search depth levels only work if the engine does support these UCI
commands.
13. Modifications to existing package were done in order to make my V3 run: python-chess for correct
support of tournaments levels, SSH communication for correct windows remote engines
14. Almost all new V3 features can be changed via the clock menu - just click through the menu to see all
possible settings, etc. (e.g., if you do not like the display of the engines name after starting a new game
(or startup) switch it off within the system display menu.)
15. The read game option is only for reading a saved game in order to continue it, not in order to replay
it
16. The new PGN engine can be used to replay a game which has to be specified in the UCI settings. You
will have to edit these UCI settings for new games or if you want to delete the examples I have added -
sorry Henri ;-) By default there are already entries for the game slots 1-3, the last game and all (played)
games. If there is more than one game in a PGN file you can define the planning sequence of the games
(up/down/by chance) if you just want to replay it or if you would like to guess the next move for one
side. Furthermore, you can specify an audio file (start/stop with pause clock button) the thinking time
for the analysis engine which will calculate a move hint and evaluation (check these by using the normal
buttons for this). Check out the UCI parameter in my examples and you will know how this works.
German users should have a look at the Hoerspiel (I liked it very much) and English spoken users at Al's
game/commentary for his Kasparov game
17. FICS Online engine: By default, you can start playing right away as guest. For a rated game or being
able to play versus a friend you will have to create a (new) user on the FICS platform (I would suggest
not to use your existing one for playing with the board) and enter your username and password to the
corresponding UCI [MatchFriend] settings of the FICS engine (fics.uci) - sorry Henry ;-). If you want to
challenge a friend add the correspond settings to the UCI file, for waiting to be challenged by a friend
add the [wait4friend] settings, see the default examples in the existing fics.uci file. You can easily try the
wait4friend option by manually login into https://chess.mobialia.com/#run (a GUI for the FICS server) as
guest and with PicoChess as your eBoard user by choosing the corresponding wait4friend level setting of
the FICS engine (after you have updated the UCI file with your eBoard user of course). Now PicoChess is
waiting for a challenge and you can do this as guest in the mobialia Web app by challenging your eBoard
user.
Starting with an almost fresh new image for my V3 takes longer than expected. These are the things I
had to do in addition to the standard PicoChess set-up (see the PicoChess 09N documentation) for my
V3 version and I almost forgot them because I did them long time ago on my system:
def go
Bug fix:
Instead of
Use the upcoming image at your own risk as I do not know if these images will really run on all your
device without any problems.
I am (still) a python programming beginner and my V3 definitely still contains several bugs which may or
may not occur with your set up - so keep that in mind. The software quality of my V3 enhancement is
definitely not the best (lots of global variables, bad software structure etc.) but it is the best I could do
and as nobody else tried it I just did it. Maybe some ideas of my code will find its way back into an
updated later "official" version of the main PicoChess repository…
I do not offer any guarantee or support for this version - so if you do not like something or something
does not work for you as you would expect: just fix it yourself or use a different image/version -
PicoChess V09N still works fine
This Version would not be possible without the great work of the PicoChess inventors, all developers
and the great community which made all this possible - thank you guys!
After all these years I am still impressed of what has been created with such a small computer and only a
chess clock and a chess board, incredible.
Big thanks to Al & Wilhelm for endless hours of testing and using my V3 in their daily chess life.
Special thanks to Al for providing a fresh compile of a really fine selection of the most interesting
engines (at least in my opinion) and all the MAME UCI files with detailed automatic time settings for
PicoChess (a new V3 feature).
The MAME emulation of the old chess computers would not be possible without the MAME dev team
(esp. "hap")" and all the Lua scripts (what an endless work) which provide an UCI wrapper for our chess
computer so that we can against them with PicoChess (thanks to Sandro Ronco and Franz with his
CBEmu project and all the help I got from Franz!)
Observations so far:
a) When I tested the images, I had to boot initially twice before the clock display was ok - do not know
why this happened but after the second boot, it was alright each time I started PicoChess again
b) I had no problems with Bluetooth connection to my eBoard or Rev II, but Al had to use the
bluetoothctl tool to pair and trust the connection to his Rev2 initially for some reason…
c) I do not know if I really like the new shutdown behavior: pressing the bottom button or putting the
two white queens beside each other) will shut down the Pi but no longer the display of the DGTPI. For
that we have to press the bottom button a second time. Then the Pi can be restarted with successful
Bluetooth reconnection. Before this change the Pi and the display have been shut down/off with the
first button press/putting the queens beside each other, but it was not possible to restart and reconnect
via Bluetooth without taking the Pi from the power supply.
Maybe I will change it later in an update (or someone else) - what do you think?
d) I have activated almost all new V3 features so that you will easily see what might be new ;-) You can
switch off and customize almost all options via the clock menu
e) The image files are about 8 GB in size zip-compressed each to download but will fit only on a at least
16 GB card.
Al was so kind to provide both images for the PicoChess community in his Dropbox account (thank you so
much for all, buddy):
PicoChessV3_DGTPI.zip
https://www.dropbox.com/s/bdplysz6ix6sz0d/PicoChesssV3_DGTPI.zip?dl=0
Non DGTPi (although this only makes sense in combination with a Revelation II because of the
enhanced display of 11 characters which you otherwise miss)
PicoChessV3_NonDGTPI.zip
https://www.dropbox.com/s/e1syzpd0xdikpam/PicoChesssV3_NonDGTPI.zip?dl=0
Enjoy (hopefully)!
Dirk Mollmann
(this last picture is for Al ;-)