Author: Joachim Rang
Date: 04:35:00 07/04/03
Go up one level in this thread
On July 04, 2003 at 05:17:47, Albert Bertilsson wrote: >Hi setting professionals! > >A while ago there was a thread about very few amatures have the possibility to >change the settings of the program, I certainly think that there can be a lot to >gain for amatures with this possibility. I seriously doubt that there are many >people taking interest in doing this for many of the weak engines out there >(like Sharper). > >I might be wrong so I give anyone the chance to have a say about Sharpers >evaluation settings, currently it's not possible to set them using a config >file, but if anyone would like to try a setting I'll compile a couple of exe >files to give him something to play with. > >Even if you don't want to develop your own Sharper setting, you might notice >something wicked in the current setting just by looking at it, and if you do >just let me know (or tweak your program to exploit it when playing Sharper =)) > >/Regards Albert > >EvaluationConstants.h >-------------------------- >#pragma once > >/* > Pieces are these: > 0 = Empty > 1 = Black pawn > 2 = White pawn > 3 = Knight > 4 = Bishop > 5 = Rook > 6 = Queen > 7 = King >*/ >const Int16 PieceValue[Types] = {0, 100, 100, 300, 325, 500, 900, 10000}; > > >const Int16 DoubleBishopBonus = 30; > > > >//King safety > >/* >The king safety is calculated in king safety units, the real value is looked up >in the KingSafety-table. If the king safety should be negative, the same table >is used, but the value is substracted instead of added. > >King safety is not used during the end game. >*/ > >const Int32 PawnShieldFactor = 2; //ks += PawnsInShield * PawnShieldFactor; >const Int32 NoPlayerPawnOnFilePenalty = 2; //if (NoPlayerPawnOnFile) ks -= >NoPlayerPawnOnFilePenalty; >const Int32 NoOpponentPawnOnFilePenalty = 2; //if (NoOpponentPawnOnFile) ks -= >NoOpponentPawnOnFilePenalty; > >const Int32 EmptySquaresLimit = 3; >const Int32 EmptySquaresFactor = 1; >//ks += (EmptySquares - EmptySquaresLimit) * EmptySquaresFactor; >//Meaning: For each empty square more than EmptySquaresLimit around the king >award EmtpySquaresFactor as bonus. >//I'm not really sure this is a good thing as a lonely king might be bad, on the >other hand this avoids the king >//getting crowded. > >const Int16 KingSafety[] = {3, 5, 9, 14, 20, 26, 32, 39, 46, 54, 62, 70, 79, 88, >98, 108, 120, 132, 146, 160, 176, 192}; > > > >/* > PST values: This is a very important table to Sharper due to lack of evaluation >of pawns etc. > > Note that squares are numbered like this: > A1, B1, C1, D1, E1, F1, G1, H1, > A2, ... > A8, B8, C8, D8, E8, F8, G8, H8, > > Due to the use of 0x88 move generation there is a board > next to the real board, just fill in zero there. >*/ >const Int8 PSTPhases[PhaseCount][Types][Squares] = >{ > //Opening phase > { > {//Empty opening > 0, > }, > {//BPawn opening > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 35, 35, 35, 35, 35, 35, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 25, 25, 25, 25, 25, 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 12, 12, 12, 15, 15, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 12, 12, 12, 12, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 10, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 0,-20,-20, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//WPawn opening > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 0,-20,-20, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 10, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 12, 12, 12, 12, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 12, 12, 12, 15, 15, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 25, 25, 25, 25, 25, 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 35, 35, 35, 35, 35, 35, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Knight opening > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Bishop opening > 0, 8, -5, 8, 8, -5, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 13, 13, 13, 13, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 13, 13, 13, 13, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, -5, 8, 8, -5, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Rook opening > 5, 10, 15, 20, 20, 15, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 10, 15, 20, 20, 15, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Queen opening > 0, 9, 9, 20, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 10, 12, 12, 12, 12, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 12, 9, 9, 9, 9, 12, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 12, 9, 9, 9, 9, 12, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 12, 9, 9, 9, 9, 12, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 12, 9, 9, 9, 9, 12, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 9, 10, 12, 12, 12, 12, 10, 9, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 9, 9, 20, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//King opening > 0, 7, 10,-10, -5,-10, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > -10,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0, 0, 0, > -20,-20,-20,-20,-20,-20,-20,-20, 0, 0, 0, 0, 0, 0, 0, 0, > -20,-20,-20,-20,-20,-20,-20,-20, 0, 0, 0, 0, 0, 0, 0, 0, > -10,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 7, 10,-10, -5,-10, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > }, > > }, > > > //Middle game > { > {//Empty middle > 0, > }, > {//BPawn middle > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 35, 35, 35, 35, 35, 35, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 25, 25, 25, 25, 25, 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 12, 12, 12, 15, 15, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 12, 12, 12, 12, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 10, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 0,-20,-20, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//WPawn middle > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 0,-20,-20, 0, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 10, 0, 0, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 10, 12, 12, 12, 12, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 12, 12, 12, 15, 15, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 25, 25, 25, 25, 25, 25, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 35, 35, 35, 35, 35, 35, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Knight middle > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Bishop middle > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 13, 13, 13, 13, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 13, 13, 13, 13, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Rook middle > 0, 10, 15, 20, 20, 15, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 0, 10, 15, 15, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 10, 0, 10, 10, 0, 10, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 20, 15, 10, 0, 0, 10, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, > 20, 15, 10, 0, 0, 10, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, > 15, 10, 0, 10, 10, 0, 10, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 0, 10, 15, 15, 10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 10, 15, 20, 20, 15, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, > > }, > {//Queen middle > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//King middle > 0, 7, 10, -5, -5, -5, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > -10,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0, 0, 0, > -10,-10,-10,-10,-10,-10,-10,-10, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 7, 10, -5, -5, -5, 10, 5, 0, 0, 0, 0, 0, 0, 0, 0, > }, > > }, > > > //End phase > { > {//Empty end > 0, > }, > {//BPawn end > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 45, 45, 45, 45, 45, 45, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 30, 30, 30, 30, 30, 30, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 15, 15, 15, 15, 15, 15, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//WPawn end > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, > 10, 15, 15, 15, 15, 15, 15, 10, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 30, 30, 30, 30, 30, 30, 15, 0, 0, 0, 0, 0, 0, 0, 0, > 30, 45, 45, 45, 45, 45, 45, 30, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Knight end > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 12, 16, 16, 16, 16, 12, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 6, 8, 12, 12, 12, 12, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 6, 8, 8, 8, 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Bishop end > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 8, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//Rook end > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > > }, > {//Queen end > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 17, 20, 20, 17, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 13, 15, 17, 17, 15, 13, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 5, 10, 13, 13, 13, 13, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 8, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > }, > {//King end > -16, -8, -4, 0, 0, -4, -8,-16, 0, 0, 0, 0, 0, 0, 0, 0, > -8, -4, 4, 8, 8, 4, -4, -8, 0, 0, 0, 0, 0, 0, 0, 0, > -4, 4, 12, 16, 16, 12, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 16, 24, 24, 16, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 8, 16, 24, 24, 16, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, > -4, 4, 12, 16, 16, 12, 4, -4, 0, 0, 0, 0, 0, 0, 0, 0, > -8, -4, 4, 8, 8, 4, -4, -8, 0, 0, 0, 0, 0, 0, 0, 0, > -16, -8, -4, 0, 0, -4, -8,-16, 0, 0, 0, 0, 0, 0, 0, 0, > }, > > } >}; > > >-------------------------- very interesting post. I'm not a programmer but I enjoyed it nevertheless. Some thoughts: Pawns in the opening: I'm not sure if it is a good thing to evaluate pawn advances in the opening positive. This might lead to premature pawn-advances in the opening. In the middle- and endgame I agree with your values. Rooks in the middlgame: I think this table is not good. Are you sure in the middlgame it is a good think to have a rook on h4, h5,g4, g5 or a4, a5, b4, b5? Another problem is, that you don't distinguish between white and black pieces. I would assume a black rook on the second row is better than on the seventh and vice versa for a white rook. I would also think a white knight on d5 is better than on c3 and a black night on d4 is better than on c6. But with only one table for the pieces you can't distinguish between these cases. regards Joachim
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.