New uci engine: Rofchade

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

User avatar
Ronald
Posts: 161
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: New uci engine: Rofchade

Post by Ronald »

Below are the PST values which work best for rofchade. As you can see very asymmetric. They are defined as if looking to the board from white (so I can understand them better..). The first square in the table [0] is square A8 and the last square [63] is H1. This means that it can be used directly for black, for white you have flip it vertically so you cant take the square XOR 56 for white.
So if you want to calculate the MG PST value of a rook on square 'sq', if the rook is WHITE you take value pieceSquareScore[MG][ROOK][sq ^ 56], if the rook is BLACK you take pieceSquareScore[MG][ROOK][sq].

I'm interested in how well they perform in other engines with full evaluation compared to your own PST and if possible stand alone without further eval elements compared to the regular version. Because all rofchade's evaluation elements are inside the PST maybe some evaluation parts are more emphasized when used together (like rook on 7th rank bonus which also shows a little bit in the PST).

Here they are:

Code: Select all

const eval pieceValue[2][6] =
{ 82, 337, 365, 477, 1025, 12000,
  94, 281, 297, 512,  936, 12000 };

const eval GAMEPHASEMINEG = 518;
const eval GAMEPHASEMAXMG = 6192;
const eval GAMEPHASERANGE = GAMEPHASEMAXMG - GAMEPHASEMINEG;

// factorMG and factorEG are calculated based on the sum of the MG values of all the pieces except pawns (pos->gamePhase)
// a sum above GAMEPHASEMAXMG is fully MG, a sum below GAMEPHASEMINEG is fully EG, the rest is interpolated:

	//const eval gamePhase = std::max(GAMEPHASEMINEG, std::min(GAMEPHASEMAXMG, pos->gamePhase));			
	//const double factorMG = (gamePhase - GAMEPHASEMINEG) / GAMEPHASERANGE;	
	//const double factorEG = 1 - factorMG;

const sptScore pieceSquareScore[2][6][64] =
// MG values
{
//pawn
      0,   0,   0,   0,   0,   0,  0,   0,
     98, 134,  61,  95,  68, 126, 34, -11,
     -6,   7,  26,  31,  65,  56, 25, -20,
    -14,  13,   6,  21,  23,  12, 17, -23,
    -27,  -2,  -5,  12,  17,   6, 10, -25,
    -26,  -4,  -4, -10,   3,   3, 33, -12,
    -35,  -1, -20, -23, -15,  24, 38, -22,
      0,   0,   0,   0,   0,   0,  0,   0,
 //knight
    -167, -89, -34, -49,  61, -97, -15, -107,
     -73, -41,  72,  36,  23,  62,   7,  -17,
     -47,  60,  37,  65,  84, 129,  73,   44,
      -9,  17,  19,  53,  37,  69,  18,   22,
     -13,   4,  16,  13,  28,  19,  21,   -8,
     -23,  -9,  12,  10,  19,  17,  25,  -16,
     -29, -53, -12,  -3,  -1,  18, -14,  -19,
    -105, -21, -58, -33, -17, -28, -19,  -23,
 //bishop
    -29,   4, -82, -37, -25, -42,   7,  -8,
    -26,  16, -18, -13,  30,  59,  18, -47,
    -16,  37,  43,  40,  35,  50,  37,  -2,
     -4,   5,  19,  50,  37,  37,   7,  -2,
     -6,  13,  13,  26,  34,  12,  10,   4,
      0,  15,  15,  15,  14,  27,  18,  10,
      4,  15,  16,   0,   7,  21,  33,   1,
    -33,  -3, -14, -21, -13, -12, -39, -21,
 //rook
     32,  42,  32,  51, 63,  9,  31,  43,
     27,  32,  58,  62, 80, 67,  26,  44,
     -5,  19,  26,  36, 17, 45,  61,  16,
    -24, -11,   7,  26, 24, 35,  -8, -20,
    -36, -26, -12,  -1,  9, -7,   6, -23,
    -45, -25, -16, -17,  3,  0,  -5, -33,
    -44, -16, -20,  -9, -1, 11,  -6, -71,
    -19, -13,   1,  17, 16,  7, -37, -26,
 //queen
    -28,   0,  29,  12,  59,  44,  43,  45,
    -24, -39,  -5,   1, -16,  57,  28,  54,
    -13, -17,   7,   8,  29,  56,  47,  57,
    -27, -27, -16, -16,  -1,  17,  -2,   1,
     -9, -26,  -9, -10,  -2,  -4,   3,  -3,
    -14,   2, -11,  -2,  -5,   2,  14,   5,
    -35,  -8,  11,   2,   8,  15,  -3,   1,
     -1, -18,  -9,  10, -15, -25, -31, -50,
 //king
    -65,  23,  16, -15, -56, -34,   2,  13,
     29,  -1, -20,  -7,  -8,  -4, -38, -29,
     -9,  24,   2, -16, -20,   6,  22, -22,
    -17, -20, -12, -27, -30, -25, -14, -36,
    -49,  -1, -27, -39, -46, -44, -33, -51,
    -14, -14, -22, -46, -44, -30, -15, -27,
      1,   7,  -8, -64, -43, -16,   9,   8,
    -15,  36,  12, -54,   8, -28,  24,  14,
    
    // EG values
 
 //pawn
      0,   0,   0,   0,   0,   0,   0,   0,
    178, 173, 158, 134, 147, 132, 165, 187,
     94, 100,  85,  67,  56,  53,  82,  84,
     32,  24,  13,   5,  -2,   4,  17,  17,
     13,   9,  -3,  -7,  -7,  -8,   3,  -1,
      4,   7,  -6,   1,   0,  -5,  -1,  -8,
     13,   8,   8,  10,  13,   0,   2,  -7,
      0,   0,   0,   0,   0,   0,   0,   0,
//knight
    -58, -38, -13, -28, -31, -27, -63, -99,
    -25,  -8, -25,  -2,  -9, -25, -24, -52,
    -24, -20,  10,   9,  -1,  -9, -19, -41,
    -17,   3,  22,  22,  22,  11,   8, -18,
    -18,  -6,  16,  25,  16,  17,   4, -18,
    -23,  -3,  -1,  15,  10,  -3, -20, -22,
    -42, -20, -10,  -5,  -2, -20, -23, -44,
    -29, -51, -23, -15, -22, -18, -50, -64,
//bishop
    -14, -21, -11,  -8, -7,  -9, -17, -24,
     -8,  -4,   7, -12, -3, -13,  -4, -14,
      2,  -8,   0,  -1, -2,   6,   0,   4,
     -3,   9,  12,   9, 14,  10,   3,   2,
     -6,   3,  13,  19,  7,  10,  -3,  -9,
    -12,  -3,   8,  10, 13,   3,  -7, -15,
    -14, -18,  -7,  -1,  4,  -9, -15, -27,
    -23,  -9, -23,  -5, -9, -16,  -5, -17,
//rook
    13, 10, 18, 15, 12,  12,   8,   5,
    11, 13, 13, 11, -3,   3,   8,   3,
     7,  7,  7,  5,  4,  -3,  -5,  -3,
     4,  3, 13,  1,  2,   1,  -1,   2,
     3,  5,  8,  4, -5,  -6,  -8, -11,
    -4,  0, -5, -1, -7, -12,  -8, -16,
    -6, -6,  0,  2, -9,  -9, -11,  -3,
    -9,  2,  3, -1, -5, -13,   4, -20,
//queen
     -9,  22,  22,  27,  27,  19,  10,  20,
    -17,  20,  32,  41,  58,  25,  30,   0,
    -20,   6,   9,  49,  47,  35,  19,   9,
      3,  22,  24,  45,  57,  40,  57,  36,
    -18,  28,  19,  47,  31,  34,  39,  23,
    -16, -27,  15,   6,   9,  17,  10,   5,
    -22, -23, -30, -16, -16, -23, -36, -32,
    -33, -28, -22, -43,  -5, -32, -20, -41,
//king
    -74, -35, -18, -18, -11,  15,   4, -17,
    -12,  17,  14,  17,  17,  38,  23,  11,
     10,  17,  23,  15,  20,  45,  44,  13,
     -8,  22,  24,  27,  26,  33,  26,   3,
    -18,  -4,  21,  24,  27,  23,   9, -11,
    -19,  -3,  11,  21,  23,  16,   7,  -9,
    -27, -11,   4,  13,  14,   4,  -5, -17,
    -53, -34, -21, -11, -28, -14, -24, -43
};
Dokterchen
Posts: 136
Joined: Wed Aug 15, 2007 12:18 pm
Location: Munich

Re: New uci engine: Rofchade

Post by Dokterchen »

Ronald wrote: Tue Aug 28, 2018 1:30 pm One of the reasons why asymmetrical tables seem to work best (for now?) probably is more short castling, but I think chess is not symmetric at all, due to the fact that we have 1 queen and king, and we have alternating colors for the squares (so bishop 1 can not reach square C1 for instance and bishop 2 van not reach C8).
WRONG! :) 35 years ago, when I was around 18 years old, I played a blitz tournament and I desperately needed a white colored bishop to attack the opponent's king, but I have had just the black one. Very easy to solve. I moved the Bc1 to h5! :D
F. Bluemers
Posts: 880
Joined: Thu Mar 09, 2006 11:21 pm
Location: Nederland

Re: New uci engine: Rofchade

Post by F. Bluemers »

Congrats with your strong engine.
I have been playing with a psq only eval,texel tuned also.It was about 150 - 170 elo weaker than the regular evaluation.
So you can look forward for some more nice elo
Best Fonzy
PK
Posts: 904
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: New uci engine: Rofchade

Post by PK »

These tables actually might turn quite strong. so far I did only a quick experiment, replacing rows 2 to 5 in Rodent's midgame piece/square table (Your values in rows 6-7 are clearly compensating for the absence of passed pawn evaluation). Surprisingly, this passed the test, very narrowly, but passed. And we are talking about just one table, used partially, and not synchronized with the rest of Rodent evaluation. Usually things like that just don't happen.

Which brings another question. Good tables imply good set of test positions for tuning (and/or some twist to the tuning code). Are You using some known position set or have You created something special?
User avatar
Ronald
Posts: 161
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: New uci engine: Rofchade

Post by Ronald »

F. Bluemers wrote: Wed Aug 29, 2018 6:49 pm Congrats with your strong engine.
I have been playing with a psq only eval,texel tuned also.It was about 150 - 170 elo weaker than the regular evaluation.
So you can look forward for some more nice elo
Best Fonzy
Thanks!

I would expect that you could gain more elo (double like 300?) with a good evaluation function, but maybe tuned PS tables can "simulate" more evaluation elements then expected.
User avatar
Ronald
Posts: 161
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: New uci engine: Rofchade

Post by Ronald »

PK wrote: Thu Aug 30, 2018 7:43 am These tables actually might turn quite strong. so far I did only a quick experiment, replacing rows 2 to 5 in Rodent's midgame piece/square table (Your values in rows 6-7 are clearly compensating for the absence of passed pawn evaluation). Surprisingly, this passed the test, very narrowly, but passed. And we are talking about just one table, used partially, and not synchronized with the rest of Rodent evaluation. Usually things like that just don't happen.

Which brings another question. Good tables imply good set of test positions for tuning (and/or some twist to the tuning code). Are You using some known position set or have You created something special?
:D It was your idea to organise a challenge for PST! With that topic you showed that PST can have a serious influence on strength (stand alone) and it resulted in an interesting discussion also. I'm really curious how much a tuned PST can simulate evaluation parts of a regular evaluation function. I hope to find out the coming months for myself...

Concerning the testset, I used the "quiet-labeled".epd set created by Alexandru Mosoi (Zurichess).
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: New uci engine: Rofchade

Post by Scally »

Hi Ronald,

I’ve tried leaving comments on your Rofchade website but they get deleted.

When do you expect the source code to be available, are we talking weeks or Months?


Thanks,

Al.
User avatar
mclane
Posts: 18883
Joined: Thu Mar 09, 2006 6:40 pm
Location: US of Europe, germany
Full name: Thorsten Czub

Re: New uci engine: Rofchade

Post by mclane »

There was an engine called breakthrough by Werner Koch.

IMO it computed very complex amount of PST etc. for all the positions in the tree and this way the program
Was often capable to make the opponent nearly not move at all.
Kind of stalemate. Where any more creates a loss,


Of course it was an experiment and breakthrough was never that strong but the games were very
Funny and reminded on a draughts game,

https://www.game-ai-forum.org/icga-tour ... php?id=196
What seems like a fairy tale today may be reality tomorrow.
Here we have a fairy tale of the day after tomorrow....
User avatar
Ronald
Posts: 161
Joined: Tue Jan 23, 2018 10:18 am
Location: Rotterdam
Full name: Ronald Friederich

Re: New uci engine: Rofchade

Post by Ronald »

Scally wrote: Tue Sep 11, 2018 1:54 pm Hi Ronald,

I’ve tried leaving comments on your Rofchade website but they get deleted.

When do you expect the source code to be available, are we talking weeks or Months?


Thanks,

Al.
Sorry, I that replies on the website are not posted directly, I first have to approve them before they are show on the site, I didn't know that..., so your reply was received, but not approved.

I'm reorganizing the source code at the moment. What should not have done is at the same time making some changes to the code, it all works now but it's better to not do 2 things at once.... I still want to do some cleanup/commenting on the source code before I make it available, it will probably be next week.

From your reply I understand that you would like to have/make a raspberry pi version for playing with picochess. I own a Digital PI of DGT myself and a few months ago it was a special moment to play on a DGT board against my own engine! I lost of course but it was great fun.
I use Visual studio for the windows builds and clang for MacOS, and the raspberry pi build from a few months ago was done with GCC, so I don't know if the current source will compile in GCC (usually not right away...). I will try to build a raspberry pi version tonight or tomorrow, as soon as I have one I will send you a message/email.
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: New uci engine: Rofchade

Post by Scally »

Hi Ronald,

Thanks for your reply, I look forward to your Engine.

I have Updated the base Raspberry Pi compilers of gcc, gdc, g++ & c++ to version 8.1.0; clang to version 6.0.0 plus added Go, ldc2, java and pascal compilers. I’ve used all to compile a bunch of engines running on Raspbian Stretch on my DGT Pi.

Recently I ported these over to the ASUS Tinker Board. This runs on TinkerOS Debian Stretch, slightly different but the majority of the engines ran immediately. The remaining 4 compiled on the Tinker Board and connect to my DGT Board fine.


Thanks,

Al.