Building my dream chess computer Part II: The software "Picochess V3"

2,288 views
Skip to first unread message

Dirk

unread,
Oct 4, 2020, 1:24:05 PM10/4/20
to PicoChess

After having described the hardware I use for my dream chess computer (see https://groups.google.com/g/picochess/c/jC-EEwEd15M) 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.

Since almost 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’s 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

set_pieces.jpg

In case you knock of some pieces and can’t remember where to put them back or if you get the „set pieces“ message and can’t 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

clear_field.jpg


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 won’t give (in this case annoying) correction messages ;-)

Thats 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 couldn’t resolve the „set pieces“  issue.


to be continued…

Dirk


RandyR

unread,
Oct 4, 2020, 1:33:57 PM10/4/20
to PicoChess
That's very cool, Dirk! I'm impressed that you learned Python enough to make enhancements to picochess, even if it is just your own personal version. A big thanks to you and everyone involved. I look forward to your 'release' when you are happy with it.

Randy

Dirk

unread,
Oct 5, 2020, 5:24:44 AM10/5/20
to PicoChess

Thanks Randy - indeed I still can only do the basic stuff with python and unfortunately don’t have a good programming style and I still don’t understand some python commands/functions used in picochess fully -  but for my changes it is obviously sufficient  ;-)

More important is the fact that I now understand picochess and its structure way better than 2 years ago - otherwise I would not have been able to do some of my more advanced features and picochess is really not that easy to understand for a beginner. Even adding a new menu option sounds easy but although not really difficult is taking a lot of effort - way more than you would think of...

Unfortunately my bad programming know how leads to really complex, bad structured code so that its is almost impossible to maintain it in the future (even now after only some weeks of absence from coding I have trouble to understand my own code :-(

But as nobody does this in a better way at the moment I am happy with that… (but this was the reason why I not suggested to use my 2.01 version (or even worse my complex V3 version) as-it-is unchanged as a new base image for further developments… 

After all that time my current version now consists of more than 40 enhancements - so its really time to write about it (somehow I missed it to do so in between :-( ) and maybe some of the features are more of a general interest….

IMG_4930.jpeg

Next feature is also a 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

1.e4 c6 2.Nf3 Qa6

Position after computer has just played Qa6 

714E3945-5FC1-4FA1-A0E7-7A7741172D40_1_105_c.jpeg

taking back Q from a6 to d8:  

A033E710-6C0F-4E61-A1EA-5F045AD51EFF_1_105_c.jpeg

Next move to be taken back for white is displayed:

Screenshot_2020-10-05 10.51.43_SC6Kch.jpg

Take back N from f3 to g1, next move to be taken back c7c6 is displayed:


3D64F401-34E7-404C-83C7-0DD3D5C98154_1_105_c.jpeg


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 can’t 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 effectivly 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 th engine (that would normally happen):

https://www.dropbox.com/s/bpcqzniha2sbczb/mame_takback2.mov?dl=0

Dirk


Dirk

unread,
Oct 5, 2020, 9:29:58 AM10/5/20
to PicoChess

I have added new time-control settings (although I won't that much ;-)

a) Tournament time control settings


Pasted Graphic.jpg

New tournament setting: n moves in g1 minutes (plus increment) and (added) rest of the game in g2 minutes eg 40 moves in 2 hours (no Fischer inc.) and rest of the game in 1.5 hours.


Pasted Graphic 1.jpg

Of course the engine must support this feature via the uci commands otherwise it won't 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

Sorry for the strange Pico Voice - it is a special voice for the mame emulated chess computer Boris ;-)

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):

#            time = m, time = g i, time = n g i  or time = n g1 I g2

#            Examples:

#            time = ... 7   (time per move, eg. m = 7 seconds)

#                       5 0 (game time, eg. Blitz g = 5 min. and 0 seconds increment)

#                       5 3 (game time g= 5 min. plus I = 3 sec. increment)

#            Tournament time control settings: n moves in g1 minutes (plus I increment seconds) and rest

#            of the game in g2 minutes

#            time = ...

#            new:   40 5 0 (n = 40 moves in g = 5 minutes)

#            new:   40 5 3 ((n = 40 moves in g= 5 minutes with I = 3s Fischer inc.)

#            new:   40 60 0 30 (n = 40 moves in g1 = 90 minutes, I = 0 seconds increment and rest of the game in g2 = 30 minutes)

The following tournament levels are predefined:

['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!)

Assuming you have python 3.5 installed:

 In file /usr/local/lib/python3.5/dist-packages/chess/uci.py: 

 line 949  original:   if movestogo is not None and movestogo > 0: 

changed to: if movestogo is not None and int(movestogo) > 0:


b) New Search Depth setting

Pasted Graphic 2.jpg

Support of a specific max. search depth (with an automatic setting of a fixed countdown movetime of 11:11)

Pasted Graphic 4.jpg

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)

Further more 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,…


Dirk

Dirk

unread,
Oct 5, 2020, 9:35:56 AM10/5/20
to PicoChess
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...

Dirk

unread,
Oct 5, 2020, 3:47:23 PM10/5/20
to PicoChess

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:

Pasted Graphic.jpg

Stockfish 9 running remotely on my MacBook controlled by picochess without  restarting picochess in remote mode. We can just choose a remote engine like all the other local engines.

Pasted Graphic 1.jpg

Remote directory for my remote Mac engines, the shell script for starting the engine and the process overview showing running stockfish 9 on my mac. 


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


 - engine name in engine.ini must start with ‚REMOTE‘

- 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)


Example extract from my engines.ini for my remote engines:

[remote_stkf9]

name = Stockfish 9 on remote server

small = Stkf9

medium = Stkf9

large = Stockfsh(R)

elo = 1500

levels = 8

ponder/brain = n


[remote_giraffe]

name = NN Giraffe by Matthew Lai (remote server)

small = girf

medium = Giraffe

large = Giraffe(R)

elo = 1500

levels = 8

ponder/brain = n


[remote_colossus]

name = Colossus 4.0 by Martin Bryant (remote server)

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)

Example for my remote entries in picochess.ini:

### =========================

### = Remote engine options =

### =========================


## Path to the remote engine - good chances you do not need them ;-)

## Please make sure that you also set 'engine-remote-home' accordingly

### Parameters for a remote engine (server)

## Where is the server with the engine

engine-remote-server = 192.168.178.34

## What user to use for connect to the remote-engine server

engine-remote-user = molli

## What password for the remote-engine-server

engine-remote-pass = XXXXXX

## The secret server-key for the remote-engine-server

# 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


Dirk

RandyR

unread,
Oct 5, 2020, 4:29:07 PM10/5/20
to PicoChess
On Monday, October 5, 2020 at 2:47:23 PM UTC-5 Dirk wrote:

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)


Dirk, I think we had to update spur and paramiko to get it working on Windows, iirc:


Randy

Dirk

unread,
Oct 5, 2020, 5:09:30 PM10/5/20
to PicoChess
Yes, that's right. Thanks for linking the original thread, Randy.

Dirk

Dirk

unread,
Oct 7, 2020, 5:09:36 AM10/7/20
to PicoChess

Pasted Graphic 3.jpg    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 machine 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 my 

      RPI3b+ on Stretch but thankfully Al the „compile wizard“ did this on his turbo 

      RPI4 now for us, see his mame for picochess thread:

      https://groups.google.com/g/picochess/c/v_yRzCgxTI8

     

      I have added several small enhancement 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)

 Pasted Graphic 1.jpg

        - 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 

Pasted Graphic 2.jpg

Boris - the King of Chess

„Boris plays black or white or even both and usually Boris plays better“ ;-)


Pasted Graphic 3.jpg


REVELATI.jpg

Sure - it is!

Boris even has its own voice from the 80s:

https://www.dropbox.com/s/xbnq3g8bc4nkt3n/Boris2.mov?dl=0


Dirk

Dirk

unread,
Oct 7, 2020, 6:07:47 AM10/7/20
to PicoChess
I forgot to mention the take back possibility of blunder moves which normally wouldn't be possible for mame engines... (that's pretty hand y for me ;-)

Dirk  

Dirk

unread,
Oct 7, 2020, 11:16:43 AM10/7/20
to PicoChess
Forgot to mention II ;-)

As 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.
Dirk

RandyR

unread,
Oct 7, 2020, 11:33:12 AM10/7/20
to PicoChess
Very impressive, Dirk! 

Are there any sound issues using the MAME engines? I know I was having alot of crackling the last time I played against them (quite a while ago now).

Randy

Dirk

unread,
Oct 7, 2020, 11:46:25 AM10/7/20
to 'Dirk' via PicoChess
Hi Randy,

what a coincidence: I just got an email from a chess friend regarding mame sound issues.

Although I am using a totally different sound system (pygame) there are still some sound issues with some of the mame engines but almost only on my DGTPI (PI3B+ inside) and not on my Pi4 connected to the REV2.

So it might be that it is because the PI is very close to the DGT3000 clock inside the DGTPI and mame sound emulation is more vulnerable for electric distortion sources.
Also the sound distortion sometimes is dependent of the running processes/threads - at least that’s my experience.

Sometimes the sound distortions vanishes after some minutes on my DGTPI.

But there are very few engines on my DGTPI having this problem and almost no on my Rev2.

Maybe we could get rid off these distortions when we switch of the sound option in mame directly (by adding the corresponding mame parameter option) but overall I like the sound of these good old machines ;-)

Dirk



--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/e3edd1bb-25da-4286-a1c7-419da3ed5658n%40googlegroups.com.

Dirk

unread,
Oct 7, 2020, 12:08:10 PM10/7/20
to PicoChess

Small enhancements of the Pico Webserver

Pasted Graphic.jpg

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 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! 

https://www.dropbox.com/s/r6k7uov0shfwmok/Webserver_up.MOV?dl=0

Dirk

RandyR

unread,
Oct 7, 2020, 12:12:19 PM10/7/20
to PicoChess
Hi Dirk. Thanks. I don't remember if I had the issues only on the DGTPi or on the RPi4 as well. I'll remember to check once we get to try out your v3. I don't think it's interference but more likely something kernel or software related. And, as you said, it's more apparent with some engines.

Randy

Dirk

unread,
Oct 9, 2020, 10:08:23 AM10/9/20
to PicoChess

As there is so much interest in a new picochess version ;-)  I will continue with my… 

Basic chess tutor functionality 

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!):

Pasted Graphic.jpg

I call it „PicoTutor“, consisting of 

- PicoWatcher

- PicoCoach

- PicoOpeningExplorer

- PicoComment


a) Pico Watcher 

Pasted Graphic 1.jpg

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:

Pasted Graphic 2.jpg

Player (name unfortunately unknown ;-) just played g4?? 

PicoTutor even tells you that you are mate in 1 

Mate in.jpg

The threat move is shown:

Pasted Graphic 4.jpg

… and a hint to avoid the threat: 

Pasted Graphic 5.jpg

The opening explorer (see below) even knows & shows the name of this mate position…

Pasted Graphic 6.jpg


https://www.dropbox.com/s/klijjkertw792zb/TUTOR_FOOLS.mov?dl=0


(...continued in the next post because of number of picture restrictions)

Dirk

unread,
Oct 9, 2020, 10:22:43 AM10/9/20
to PicoChess

The determination of  the annotations ??, ?, !?, ?!, !, !! is very loosely based on a mathematical framework I found here:

http://www2.eng.cam.ac.uk/~tpl/chess/annotation.html (unfortunately I can’t find the exact formulas anymore on this site).

You can modify the parameters which will determine the check result by editing the file „picotutor_constants.py" in the main /opt/picochess directory,  

for detailed explanation read the file comments.

# PICO TUTOR CONSTANTS

LOW_DEPTH            = 5             ## for „obvious“ moves calculation

DEEP_DEPTH           = 19          ## for best move calculation

NUM_THREADS      = 1             ## number of parallel threads (should not be higher as it is running in parallel to the main engine)

VERY_BAD_MOVE_TH     = 2.5 ## diff curr to best move

BAD_MOVE_TH                  = 1.5 ## diff curr to best move

DUBIOUS_TH                      = 0.3 ## ?!

VERY_GOOD_MOVE_TH    = 0 ## diff to best move

GOOD_MOVE_TH         = 0.3 ## diff to best move

INTERESTING_TH       = 0.3 ## !?

POS_INCREASE         = 0.5 ## for history diffs and ?!

POS_DECREASE         = -0.5 ## for history diffs and !?

VERY_GOOD_IMPROVE_TH = 2.5 ## for low_deep_diff

GOOD_IMPROVE_TH      = 1.5 ## for low_deep_diff

UNCLEAR_DIFF         = 0.7 ## unclear position & move


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 

Pasted Graphic 7.jpg

The PicoCoach will give the position score and (evtl. more than one) move hint(s). 

Activation of the PicoCoach during game play without pressing any button:

Just lift up a piece from the board when it is your turn and put it back  before the ‚set pieces‘ message appears (otherwise nothing will happen). 

Pasted Graphic 8.jpg

The evaluation and one or more hint moves will be given…  


Pasted Graphic 9.jpg

Pasted Graphic 10.jpg


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.

Pasted Graphic 11.jpg

Pasted Graphic 12.jpg

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…

That was.jpg

expected.jpg

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 don’t 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).


Dirk

RandyR

unread,
Oct 9, 2020, 10:46:58 AM10/9/20
to PicoChess
Simply amazing, Dirk!

Does the computer pause after it shows you your blunder or is it just a delay? Also, is it possible to scroll the text across the display (like a banner) rather than showing a line at a time? Maybe that would look strange on 6/8 character displays.

Randy

Dirk

unread,
Oct 9, 2020, 11:03:57 AM10/9/20
to 'Dirk' via PicoChess
Hi Randy,

In case of mame engines it is really a pause waiting of you to take either the last move back or confirm the last played move by pressing the lever. This I have done because there is no possibility at the moment for mame engine ta take back moves at all (we would have to implement individual plugin functionalities for each mame engine), see the „automatic“ take back video for my enhanced mame support in V3.

For „real“ uci (non mame) engines it is only a delay because we can take back moves at any time.

Regarding the display of long text in a sequence:

Yes I first thought about the scrolling text banner (in fact that’s the way how it is done in Boris or Sargon MGS) but I am not sure if python would be fast enough to display this the text without flickering (I think it is not possible - at least not for me ;-)

So I just wrote a routine that checks the length of a text message and if it longer than 11 chars I try to find the last word of the message that is smaller then 11 and then show th rest of the message. That was a straight forward solution to that problem and can be used for all kind of longer output like opening names or th written game comments…


Dirk


--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

RandyR

unread,
Oct 9, 2020, 11:09:25 AM10/9/20
to PicoChess
Got it. Thanks.

Dirk

unread,
Oct 11, 2020, 9:31:07 AM10/11/20
to PicoChess

Finally, I can see the light!

Don’t 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 2.

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):

IMG_4980 2.jpeg

Move g6 to be taken back:

IMG_7515 (1).jpeg


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:

IMG_7511.jpeg


Enlightened greetings

Dirk

Dirk

unread,
Oct 11, 2020, 10:23:25 AM10/11/20
to PicoChess

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)
  • BugFix for Buster/RaspianOS: 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 vorbis ogg 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 Installlation of an additional lib via: "sudo apt-get install python3-pygame“

Dirk

unread,
Oct 11, 2020, 11:30:03 AM10/11/20
to PicoChess

Look your Opponent straight into the eyes!

It seems to be a small enhancement but for me a 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. 

IMG_4942.jpeg

With this setting after startup or staring a new game you will see the engine name instead of the clock starting times:

Pasted Graphic 6.jpg

(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:

(Result 1-0).jpg


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:

Corresponding pgn file „last_game.pgn“:

[Event "PicoChess Game"]

[Site "Hamburg"]

[Date "2019.08.02"]

[Round "?"]

[White "Molli"]

[Black "Stockfish 9 64 POPCNT (level     2)"]

[Result "*"]

[Time "11:44:41"]

[WhiteElo "1300"]

[BlackElo "1500"]

[PicoDepth "0"]

[PicoTimeControl "5 0"]

[PicoRemTimeW "280"]

[PicoRemTimeB "290"]

[Opening "Caro-Kann: 2.Nf3"]

[ECO "B10o"]

1. e4 c6 *


Before reading/continuing  the last saved game:

500 500.jpg

Restoring the last game:

last Game.jpg

Remaining times restored: 

Pasted Graphic 8.jpg


Slight Analysis Mode Enhancement

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 an 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.


(full) Support of engine subfolders

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 eg. [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:

Here you see my current engine folder structure in amv7l:

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.

sftp:pi@192.168.178.80 - FileZilla 2020-10-11 15-58-25.jpg


Dirk

Dirk

unread,
Oct 14, 2020, 2:43:08 PM10/14/20
to PicoChess

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's it

*** IMPORTANT ***

Engines in favorite.ini must also appear in engines.ini!!!

Pasted Graphic.jpg

IMG_7347.jpeg

Playing Alternative Moves

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)

Pasted Graphic 2.jpg

Example: Computer wants to play c5


Pasted Graphic 4.jpg

But with the new game setting "alternative move" on…

Pasted Graphic 5.jpg

… it is now possible to play an alternative move g6 instead of computer move c5 player. 

Picochess announcement: „Playing an alternative move“


https://www.dropbox.com/s/k81kpvul2m5g6ia/alternate_move.mov?dl=0


Dirk

Dirk

unread,
Oct 15, 2020, 2:30:16 PM10/15/20
to PicoChess

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 don't 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 Werbserver 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 don’t 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:

Game SetUp.jpg

Choose the “Save Game“ option…


Revelation II Version 3.33M.jpg

Choose one the the three possible game slots Game 1, Game 2 & Game 3:

Bluetooth e-Board.jpg

Thats it.

Games are save into the /opt/picopchess/game folder:


Server optpicoches.jpg


In order to contuse the game later just enter the Game Setup menu again and select the „Read Game“ option.

Read Game.jpg

Choose one of the four possible game slots: last game, game 1, game 2, game 3 & game 4:

Bluetooth e-Board.jpg

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….

000.01 ÷ 000.01.jpg


or use directly the new pico position direction via the clock display….

IMG_7511.jpeg

Remark:

As you can see: at the moment the last used engine is  not automatically saved/restored.

Corresponding pgn file „picochess_game_3.pgn“:

[Event "PicoChess Game"]

[Site "Hamburg"]

[Date "2020.10.01"]

[Round "?"]

[White "Molli"]

[Black "Chess Champion: Mark V (mess 0.225) (01-1s move)"]

[Result "*"]

[Time "23:33:43"]

[WhiteElo "1300"]

[BlackElo "1465"]

[PicoDepth "0"]

[PicoTimeControl "1"]

[PicoRemTimeW "1"]

[PicoRemTimeB "1"]

[PicoOpeningBook ""]

[Opening "Reti: 2.c4"]

[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 *


Dirk


Dirk

unread,
Oct 16, 2020, 2:30:23 AM10/16/20
to PicoChess

Dirk

unread,
Oct 19, 2020, 3:10:43 PM10/19/20
to PicoChess
More about engine related software changes in V3 you can read here:

Henri

unread,
Oct 20, 2020, 11:30:27 AM10/20/20
to PicoChess
Hi there Dirk,

Until now I kept quiet, but I can not do that any longer. What the HECK have you been doing the last couple of years? As a vivid user I was hoping for some improvement in Picochess after 2.01, something like a better take-back function or whatever. But what you have presented here with your personal 3.0 version is miraculous, outstanding and breathtaking. You have not implemented a few little tricks, no you have lifted the whole Picochess concept to a level I could not dream of with options I could not have imagined. All I can do is to be in awe and congratulate you on a exceptional archievement.

And yes, though hesitant and shy, I WILL pose the ultimate question: Is there any chance for bringing out this version? Together with MAME and a couple of wizard Al's engines it would turn the (DGT)Pi into a formidible, may I say ultimate chess computer. If I can help you in any way during this process, let me know.

Sir, I salute you! :)

Henri

Op maandag 19 oktober 2020 om 21:10:43 UTC+2 schreef Dirk:

Dirk

unread,
Oct 20, 2020, 6:25:27 PM10/20/20
to PicoChess

Hi Henri,

thank you for your really kind words! 

Indeed with all these changes I diid over the last  1,5 years picochess now feels kind of complete for me. The hundreds of hours I could only invest in picochess because of   health issues  which lead to a cut-back of my regular work.

It is such a pity that nobody else with better programming experience jumped at the opportunity and started to continue the work of Jean-Francois, Shiv & Jürgen - besides some announcements in this forum. I would have loved to join a team during the last year with my all my ideas and I am sure that all my enhancements could be programmed in a much better way so that the code would be better structured and easier to maintain.

Now the code looks like a „rag rug“ (is that the right word?) and I really have difficulties to understand my own code after some weeks of PicoChess absence :-(

That’s the reason I was never really keen on „publishing“ these things at all. But good friends of mine convinced me that probably a lot of people would be interested in these enhancements and it would be a pity to keep it for myself (I really did all these things just for me - in order to get my dream chess computer). 

And in the end picochess lives from the fact that the sources are publicly available and that it was (and still is in my opinion) a more or less a community work… I only could do my enhancements because of that fact!

Anyway - at least my V3 enhancements work for me (and as it looks like Al and Wilhelm are also enjoying it although they get almost daily updates of source changes for testing - again thank you guys!).

So yes, I will „publish“ my V3 somehow but it is clear clear that someone has to built and provide an image because of the (too) many manual adjustments, installations and modification of the the python-chess library (yeah there are bugs as well ;-) and other package changes. etc. - but I’m sure  we find a way when its time.

At the moment we got some crashes because of my very last changes (the pico position directions & deeper mame integration like automatic takeback) it needs some more bug fixes so that slowly but surely it is getting stable again.

I still have some work in progress (for my „enhanced-ici engines“ concept) which I wanted to finish first but I as have substantial dev problems with these and  because they are almost independent of the main picochess code  I might not wait for them - I will see…

Thanks Henri for your offer to help when releasing my V3 - I will keep that in mind.

Dirk

Dirk

unread,
Nov 5, 2020, 8:44:25 AM11/5/20
to PicoChess
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 

CCMKii.jpg

1. Last move of a game is now send 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.

(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 Fidelities 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:

end.jpg



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.

Not very elegant but at least possible solution for now.
Dirk

RandyR

unread,
Nov 5, 2020, 11:43:39 AM11/5/20
to PicoChess
Simply amazing what you have accomplished, Dirk!

Randy

Henri

unread,
Nov 5, 2020, 11:48:47 AM11/5/20
to PicoChess
Thank you for solving 'my' problem Dirk! Great job!

Henri

Op donderdag 5 november 2020 om 17:43:39 UTC+1 schreef RandyR:

Scally

unread,
Nov 5, 2020, 5:39:08 PM11/5/20
to PicoChess

Hi Dirk,

I finally got Voice Challenger to resign, and can confirm your new code works as designed.

I selected my white win with the 2 white kings, then selected the engine and level again and set up the pieces for a new game.

I was able to start a new game.


Thanks,

Al.

Dirk

unread,
Dec 12, 2020, 12:38:00 PM12/12/20
to PicoChess

This is the thread for the V3 images: https://groups.google.com/g/picochess/c/SpNFpp2Scw4?pli=1

Reply all
Reply to author
Forward
0 new messages