Material tables

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Material tables

Post by hgm »

I decided to equip my next engine with material tabes. The question, however, is what to put in them. One task, of course, is to account for the Bishop pair. This in itself is enough to justify having them. The question is what other stuff I could add to it for free.

Of course there are the KBK, KNK annd KNNK cases, that should be corrected to draws. In fact they can be seen as the extreme end of a more general rule: when ahead in Piece (= non-Pawn) material, avoid trading Pawns. This rule should probably be applied progressively: trading from 8 vs 8 pawns to 7-7 or even 6-6 should probably be seen as (necessary) progress towards a win, even when you are ahead in Piece material, to open up the position and get able to exploit the advantage. But certnly from 4-4 on, trading should be discouraged, while trading the last Pawns is often completey fatal.

When ahead only in Pawns, trading more Pawns would probably be kind of neutral, although 1-0 without mating potential in your Pieces probably deserves some penalty.

A second thing that could be handled by the material table is an incentive to trde Pieces when you are ahead. The less Piece material on the board, the more easily it is to exploit an advantage. This can become quite dramatic when the weak side is reduced to Pawns only. Even being just a Pawn behind is then almost always fatal.

The table could also be used to discourage 'strange' trades (like Q-RR of Q-BBN), by giving a penalty for a complex advantage over a simple advantage. (The latter being defined as having something extra, but otherwise matching the opponent 1 for 1.)

So I have:
1) Bishop pair
2) Pawn-trade discouragement when ahead in Pieces
3) Piece-trade incentive when ahead
4) Penalty for no mating potential in Pieces
5) Penalty for no Pawns
6) Reduction of complex advantages

Is there anything I left out?
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: Material tables

Post by Richard Allbert »

Yes, advantage for the exchange RvsN and RvsB.

I've written a class in Jabba to run collect stats from databases of games, and ran 900k Playchess engine room games.

For the exchange I ended up with

Code: Select all

const int m = (vN-vR);
const int n = (vB-vR);
const int exchBR[7] = {200+m,200+m,175+m,150+m,120+m,100+m,80+m};
const int exchNR[7]  = {220+n,220+n,190+n,170+n,150+n,125+n,104+n};
Where Pawn = 100, array indexed by the number of majors for on the board (assumes max of 6)

I also ooked at NvsB for number of pawns on the board

Code: Select all

const int NvsB[17]={-24,-24,-24,-21,-18,-15,-12,-9,-6,-3,0,3,6,9,12,12};
.. and at some endings


Code: Select all

//endings
const int BPppp = (2*PAWNBASE - vB + 118);
const int BPPpppp = (2*PAWNBASE - vB + 160);
const int NPppp = (2*PAWNBASE - vN + 51);
const int NPPpppp = (2*PAWNBASE - vN + 118);
Not that

a. I really know what I'm doing
b. I've actually etsted these yet... :D

Richard
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Material tables

Post by Edmund »

I would suggest reading Larry Kaufmans great article about Material Imbalances http://home.comcast.net/~danheisman/Art ... alance.htm

In it you find additional ideas like the values of pieces relative to the number of pawns (eg. less pawns result in more potential mobility for sliders)

regards,
Edmund
Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 6:44 pm
Location: Bulgaria

Re: Material tables

Post by Mincho Georgiev »

Edmund wrote:I would suggest reading Larry Kaufmans great article about Material Imbalances http://home.comcast.net/~danheisman/Art ... alance.htm

In it you find additional ideas like the values of pieces relative to the number of pawns (eg. less pawns result in more potential mobility for sliders)

regards,
Edmund
I'm using approximately the same weights for rook and knight imbalance, pointed by L.K. in his article and I think it goes very well combined with my initial material values, here is a snippet:

Code: Select all

///pieces values:
#define P_VALUE 100
#define N_VALUE 321
#define B_VALUE 325
#define R_VALUE 500
#define Q_VALUE 950

//material adjustment [own_piececount][own_pawns]
const int rook_imbalance[10] = 
{60, 48, 36, 24, 12, 0,-12,-24,-36, 0};

const int knight_imbalance[10] = 
{-30, -24, -18, -12, -6,  0,  6, 12, 18, 0};

//actual code:
	score[W] += rooks[W]   * rook_imbalance[pawns[W]];
	score[W] += knights[W] * knight_imbalance[pawns[W]];
	score[B] += rooks[B]   * rook_imbalance[pawns[B]];
	score[B] += knights[B] * knight_imbalance[pawns[B]];
Now, regarding the bishop pair, here is my explanation, sent once to Larry Kaufman:

Regarding the bishop pair, in my program, I'm considering it as a completely separated piece from others, i.e. i don't re-value the bishops depending of pawns, i do re-value of the those 50 points down - pawns count dependent to the minimum of 50pts - 16pawns = 34pts (initially).
I tried other things as well, but it seems the bishops gets too favored by my program and that causes sometimes bad NxB exchanges.
Just a couple of ideas for considering.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Material tables

Post by hgm »

Edmund wrote:I would suggest reading Larry Kaufmans great article about Material Imbalances http://home.comcast.net/~danheisman/Art ... alance.htm

In it you find additional ideas like the values of pieces relative to the number of pawns (eg. less pawns result in more potential mobility for sliders)
Would the dependence of piece values quoted there not simply be an effect of average mobility, which you would already incorporate automatically when you would incude a mobility term in your evaluation, rather than needing explicit treatment in a material table?
User avatar
Desperado
Posts: 879
Joined: Mon Dec 15, 2008 11:45 am

Re: Material tables

Post by Desperado »

Hello,

- recognizers for special endgame procedures
- phase value(s)

regards, Michael
Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 6:44 pm
Location: Bulgaria

Re: Material tables

Post by Mincho Georgiev »

hgm wrote:
Edmund wrote:I would suggest reading Larry Kaufmans great article about Material Imbalances http://home.comcast.net/~danheisman/Art ... alance.htm

In it you find additional ideas like the values of pieces relative to the number of pawns (eg. less pawns result in more potential mobility for sliders)
Would the dependence of piece values quoted there not simply be an effect of average mobility, which you would already incorporate automatically when you would incude a mobility term in your evaluation, rather than needing explicit treatment in a material table?
I apologize if your question is addressed to Edmund, but if it's not, i will say
that mobility and center control have separate weights in my code, separated from the imbalance calculations.
yoshiharu
Posts: 56
Joined: Sat Nov 11, 2006 11:14 pm

Re: Material tables

Post by yoshiharu »

hgm wrote: Would the dependence of piece values quoted there not simply be an effect of average mobility, which you would already incorporate automatically when you would incude a mobility term in your evaluation, rather than needing explicit treatment in a material table?
I think that it is useful to treat it explicitly (though I don't use tables for that, I just compute them on the fly), since it can be useful to help avoid bad trades when, e.g., your bishop is not very active in the "static" sense, but will become better later, while your opponent's knight is good now, but weaker in the endgame (too few pawns maybe).
Actually that bonus is not very high, it is just meant to give the engine some knowledge about the likely endings that can be reached from the position: and that should be the (main) role of the imbalance table, shouldn't it?

Of course, everything IMHO :-)

Cheers, Mauro
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Material tables

Post by Edmund »

hgm wrote:
Edmund wrote:I would suggest reading Larry Kaufmans great article about Material Imbalances http://home.comcast.net/~danheisman/Art ... alance.htm

In it you find additional ideas like the values of pieces relative to the number of pawns (eg. less pawns result in more potential mobility for sliders)
Would the dependence of piece values quoted there not simply be an effect of average mobility, which you would already incorporate automatically when you would incude a mobility term in your evaluation, rather than needing explicit treatment in a material table?
As also already pointed out by Mauro Riccardi, it is more about the potential mobility of a piece in a certain material configuration on the board rather than the actual position. But probably it is not easy to seperate the two in an analysis of game results as was done by Kaufman. So if you use a combination of this material eval term and the dynamic mobility evaluation the values given in the paper might need scaling down.
kingliveson

Re: Material tables

Post by kingliveson »

Primitive Material/Mobility:

Queen = 1456

21 21 21 21 21 21 21 21
21 23 23 23 23 23 23 21
21 23 25 25 25 25 23 21
21 23 25 25 27 25 25 21
21 25 25 27 25 25 23 21
21 23 25 25 25 25 23 21
21 23 23 23 23 23 23 21
21 21 21 21 21 21 21 21


Rook = 896

14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14
14 14 14 14 14 14 14 14

Bishop x 2 = 560

7 7 7 7
9 9 9 7
7 11 11 9
9 13 11 7
7 11 13 9
9 11 11 7
7 9 9 9
7 7 7 7


Knight = 336

2 3 4 4 4 4 3 2
3 4 6 6 6 6 4 3
4 6 8 8 8 8 6 4
4 6 8 8 8 8 6 4
4 6 8 8 8 8 6 4
4 6 8 8 8 8 6 4
3 4 6 6 6 6 4 3
2 3 4 4 4 4 3 2

Pawn = 140

2 3 3 3 3 3 3 2
2 3 3 3 3 3 3 2
2 3 3 3 3 3 3 2
2 3 3 3 3 3 3 2
2 3 3 3 3 3 3 2
3 4 4 4 4 4 4 3

Franklin