Evaluate the pieces mobility

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Daniel Anulliero
Posts: 734
Joined: Fri Jan 04, 2013 3:55 pm
Location: Nice

Evaluate the pieces mobility

Post by Daniel Anulliero » Mon Apr 25, 2016 2:23 pm

Hi all
Last week I put some evaluation of mobility in Isa . Very primitive scheme :
"every empty squares are ok " :?
Ihave four array , for each piece (Knight , bishop , rook , queen) :

Code: Select all

Knight table :
int p_mob[9] = {-10, -8, -6, -4, 0, 6, 8, 12, 15};

Bishop table : 
int p_mob[14] = {-10, -9, -8, -7, -5, -2, 0, 2, 4, 6, 8, 10, 12, 15};

Rook table:
int p_mob[15] = {-10, -9, -8, -7, -6, -5, -4, 0, 2, 4, 6, 8, 10, 12, 12};

Queen table : 
int p_mob[28] = {-10, -10, -9, -9, -8, -8, -7, -7, -6, -6, -5, -5, -4, -2,0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 12};
What do you think about these value ?
I don't know if I can have the same values for each pièces (from -10 to 12/15)

give me your advice about my scheme
Thanks !

User avatar
yurikvelo
Posts: 604
Joined: Sat Dec 06, 2014 12:53 pm

Re: Evaluate the pieces mobility

Post by yurikvelo » Mon Apr 25, 2016 2:43 pm

Stockfish 7

Code: Select all

  // MobilityBonus[PieceType][attacked] contains bonuses for middle and end
  // game, indexed by piece type and number of attacked squares in the MobilityArea.
  const Score MobilityBonus[][32] = {
    {}, {},
    { S(-75,-76), S(-56,-54), S(- 9,-26), S( -2,-10), S(  6,  5), S( 15, 11), // Knights
      S( 22, 26), S( 30, 28), S( 36, 29) },
    { S(-48,-58), S(-21,-19), S( 16, -2), S( 26, 12), S( 37, 22), S( 51, 42), // Bishops
      S( 54, 54), S( 63, 58), S( 65, 63), S( 71, 70), S( 79, 74), S( 81, 86),
      S( 92, 90), S( 97, 94) },
    { S(-56,-78), S(-25,-18), S(-11, 26), S( -5, 55), S( -4, 70), S( -1, 81), // Rooks
      S(  8,109), S( 14,120), S( 21,128), S( 23,143), S( 31,154), S( 32,160),
      S( 43,165), S( 49,168), S( 59,169) },
    { S(-40,-35), S(-25,-12), S(  2,  7), S(  4, 19), S( 14, 37), S( 24, 55), // Queens
      S( 25, 62), S( 40, 76), S( 43, 79), S( 47, 87), S( 54, 94), S( 56,102),
      S( 60,111), S( 70,116), S( 72,118), S( 73,122), S( 75,128), S( 77,130),
      S( 85,133), S( 94,136), S( 99,140), S(108,157), S(112,158), S(113,161),
      S(118,174), S(119,177), S(123,191), S(128,199) }
  };

....

        int mob = popcount<Pt == QUEEN ? Full &#58; Max15>&#40;b & mobilityArea&#91;Us&#93;);

        mobility&#91;Us&#93; += MobilityBonus&#91;Pt&#93;&#91;mob&#93;;

  // Do not include in mobility area squares protected by enemy pawns, or occupied
  // by our blocked pawns or king.
  Bitboard mobilityArea&#91;&#93; = &#123;
    ~&#40;ei.attackedBy&#91;BLACK&#93;&#91;PAWN&#93; | blockedPawns&#91;WHITE&#93; | pos.square<KING>&#40;WHITE&#41;),
    ~&#40;ei.attackedBy&#91;WHITE&#93;&#91;PAWN&#93; | blockedPawns&#91;BLACK&#93; | pos.square<KING>&#40;BLACK&#41;)
  &#125;;


  // Evaluate all pieces but king and pawns
  score += evaluate_pieces<DoTrace>&#40;pos, ei, mobility, mobilityArea&#41;;
  score += mobility&#91;WHITE&#93; - mobility&#91;BLACK&#93;;


Henk
Posts: 6768
Joined: Mon May 27, 2013 8:31 am

Re: Evaluate the pieces mobility

Post by Henk » Mon Apr 25, 2016 2:48 pm

LISTEN to the experts and start CLONING Stockfish NOW. No need to reinvent the wheel.

Daniel Anulliero
Posts: 734
Joined: Fri Jan 04, 2013 3:55 pm
Location: Nice

Re: Evaluate the pieces mobility

Post by Daniel Anulliero » Mon Apr 25, 2016 3:01 pm

HENK : your answer are just like always : very useful , kind and clever lol
Personally I dont want to clone anything , I listen experts advices , not you , that's why your engine is what it is ..
Better you Concentrate your efforts to make Skipper à chess player instead of writing silly things

Sorry for that , mister admin , but this guy make me nervous. ...

User avatar
yurikvelo
Posts: 604
Joined: Sat Dec 06, 2014 12:53 pm

Re: Evaluate the pieces mobility

Post by yurikvelo » Mon Apr 25, 2016 3:11 pm

Henk wrote:LISTEN to the experts and start CLONING Stockfish NOW. No need to reinvent the wheel.
Why cloning. Saving time to understand mistakes.

"every empty squares are ok " missing very important thing "do not count squares protected by enemy pawns, or occupied by our blocked pawns or king"

If he is not going to implement this counter, it will break the whole Mobility idea.

Daniel Anulliero
Posts: 734
Joined: Fri Jan 04, 2013 3:55 pm
Location: Nice

Re: Evaluate the pieces mobility

Post by Daniel Anulliero » Mon Apr 25, 2016 3:15 pm

yurikvelo wrote:
Henk wrote:LISTEN to the experts and start CLONING Stockfish NOW. No need to reinvent the wheel.
Why cloning. Saving time to understand mistakes.

"every empty squares are ok " missing very important thing "do not count squares protected by enemy pawns, or occupied by our blocked pawns or king"

If he is not going to implement this counter, it will break the whole Mobility idea.
Yes I know what you mean , but my engine is in developement , and so weak , I add things gradualy to see the improvement ... if there is an improvment :)

just adding this primitive mobility eval , improve Isa by 25 elo (ok , just 60 games played +25 elo with +-72 error bar lol)
playing 600 games right now


last thing : no answer to henk's posts , he is just a troll :wink:

F. Bluemers
Posts: 867
Joined: Thu Mar 09, 2006 10:21 pm
Location: Nederland
Contact:

Re: Evaluate the pieces mobility

Post by F. Bluemers » Mon Apr 25, 2016 3:52 pm

Daniel Anulliero wrote:Hi all
Last week I put some evaluation of mobility in Isa . Very primitive scheme :
"every empty squares are ok " :?
Ihave four array , for each piece (Knight , bishop , rook , queen) :

Code: Select all

Knight table &#58;
int p_mob&#91;9&#93; = &#123;-10, -8, -6, -4, 0, 6, 8, 12, 15&#125;;

Bishop table &#58; 
int p_mob&#91;14&#93; = &#123;-10, -9, -8, -7, -5, -2, 0, 2, 4, 6, 8, 10, 12, 15&#125;;

Rook table&#58;
int p_mob&#91;15&#93; = &#123;-10, -9, -8, -7, -6, -5, -4, 0, 2, 4, 6, 8, 10, 12, 12&#125;;

Queen table &#58; 
int p_mob&#91;28&#93; = &#123;-10, -10, -9, -9, -8, -8, -7, -7, -6, -6, -5, -5, -4, -2,0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 12&#125;;
What do you think about these value ?
I don't know if I can have the same values for each pièces (from -10 to 12/15)

give me your advice about my scheme
Thanks !
for queenmob Dirty only used to count squares not attacked by enemy pawns,
It does this now for all pieces,but for the other pieces it seems a wash.

F. Bluemers
Posts: 867
Joined: Thu Mar 09, 2006 10:21 pm
Location: Nederland
Contact:

Re: Evaluate the pieces mobility

Post by F. Bluemers » Mon Apr 25, 2016 3:54 pm

Henk wrote:LISTEN to the experts and start CLONING Stockfish NOW. No need to reinvent the wheel.
Who are these experts?
Any names?

Henk
Posts: 6768
Joined: Mon May 27, 2013 8:31 am

Re: Evaluate the pieces mobility

Post by Henk » Mon Apr 25, 2016 3:55 pm

Daniel Anulliero wrote:HENK : your answer are just like always : very useful , kind and clever lol
Personally I dont want to clone anything , I listen experts advices , not you , that's why your engine is what it is ..
Better you Concentrate your efforts to make Skipper à chess player instead of writing silly things

Sorry for that , mister admin , but this guy make me nervous. ...
Chess market is saturated every minute you spent on it is a waste.

F. Bluemers
Posts: 867
Joined: Thu Mar 09, 2006 10:21 pm
Location: Nederland
Contact:

Re: Evaluate the pieces mobility

Post by F. Bluemers » Mon Apr 25, 2016 3:58 pm

Henk wrote:
Daniel Anulliero wrote:HENK : your answer are just like always : very useful , kind and clever lol
Personally I dont want to clone anything , I listen experts advices , not you , that's why your engine is what it is ..
Better you Concentrate your efforts to make Skipper à chess player instead of writing silly things

Sorry for that , mister admin , but this guy make me nervous. ...
Chess market is saturated every minute you spent on it is a waste.
Still no excuse to T**LL others

Post Reply