Geschrieben von: / Posted by: Uri Blass at 17 September 2003 22:54:10:
Als Antwort auf: / In reply to: Re: Bug in OliThink 4.1.0 geschrieben von: / posted by: Dr. Oliver Brausch at 17 September 2003 21:56:06:
I also download the source code and I am interested to know more about olithink mobility evaluation.
I think that it is better to know the best simple stuff for mobility before implementing complcated stuff.
Here is olithink evaluation
int eval(int on_move, int alpha, int beta) {
if (p == PAW_B) { poseval += ((aSrtAttack[i][j][0] & Empty) ? 5 : 3) * pawn_val[i][c]; continue; }
if (p == KNI_B) { poseval += knightmobil[i] * pos_val[j]; continue; }
if (p == BIS_B) { poseval += bitcount(A045(i) | A135(i)) * pos_val[j]; continue; }
if (p == ROO_B) { poseval += bitcount(A000(i) | A090(i)) * pos_val[j]; continue; }
if (p == KIN_B) { poseval -= kingmobil[i] * pos_val[j ^ (!R000BitB[QUEEN[c^1]])]; }
}
return on_move ? -(material+poseval) : (material+poseval);
}
I guess from the names that it analyze mobility but
Unfortunately there are varaibles that I do not understand like P000 and
when I look for that varaible I see that it is defined based on other varaibles
If 100 means 1 pawn then I think that it is too low because I guess that cases when the evaluation is more than 130 based on piece square table and simple ealuation are not very rare.
I see that it is using aSrtAttack that is also used for mobility
knightmobil[i] = bitcount(aSrtAttack[i][KNI_W][1]);
I do not understand what it is.
....
ups, this is 4.0.x, pawns have gone out of this in 4.1.0
This is correct, my only eval is mobility (and pawn structure now)
P000 is easy (and very important). if you look
void upBitHelpers() {
P000 = R000BitB[COL_W] | R000BitB[COL_B];
}
you will see that P000 is the 0-degree (standard) bitboard that contains
ALL pieces. P stands for Piece:-)
thats true. i think this can be improved.
aSrtAttack[i][KNI_W][1] is the bitboard that contains all
fields, where a White Knight, positioned on field i can go.
the more bits, the better:-)
Oliver
I almost do not use bitboards(use them only for pawn structure) so I do not know standard bitboard but I understand what is the bitboard that contain all pieces(1 for piece in the board and 0 for no piece)
Does it mean the number of moves that a knight can move(capture or empty squares)
I also do not understand what does
bitcount(A045(i) | A135(i)) means
Does it means only part of the diagnols that bishop can move or all of them.
I can guess that it means only diagnols that it moves forward
but I am not sure.
Do I understand correctly that you do not evaluate queen mobility?
I also understand that you multiply it by a constant
You have
pos_val[16] = {10,-10,10,-10,6,-6,8,-8,4,-4,1,-1,5,-5,0,0};
#define ENP_W 0
#define ENP_B 1
#define PAW_W 2
#define PAW_B 3
#define KNI_W 4
#define KNI_B 5
#define BIS_W 6
#define BIS_B 7
#define ROO_W 8
#define ROO_B 9
#define QUE_W 10
#define QUE_B 11
#define KIN_W 12
#define KIN_B 13
#define EMPTY 14
I understand from it that you multiply knight mobility by 6,
bishops mobility by 8 rooks mobility by 4,king mobility by 5 when
I guess based on
if (p == KIN_B) { poseval -= kingmobil[i] * pos_val[j ^ (!R000BitB[QUEEN[c^1]])];.
That there are cases when it is bad to have good mobility(maybe when the opponent has queens)
Uri