However, I feel that just piling up eval terms, while it does allow very good (inspired) play at times by Romi, leads to very bad play, as well. Therefore I have tried various ways to 'normalize' the eval to keep Romi's inspired play and to prevent loosing distortions from from ruining otherwise good games.
It seems that all ways to normalize have inherent problems and all result in weaker play. That is untill this last attempt.
Code: Select all
void Normalize() {
s32 sq;
s32 highWN;
s32 highBN;
s32 highWB;
s32 highBB;
s32 highWR;
s32 highBR;
s32 highWQ;
s32 highBQ;
highWN = -INFINITY;
highBN = -INFINITY;
highWB = -INFINITY;
highBB = -INFINITY;
highWR = -INFINITY;
highBR = -INFINITY;
highWQ = -INFINITY;
highBQ = -INFINITY;
for(sq = A1; sq <= H8; sq++) {
if(wKnightTbl[sq] > highWN) highWN = wKnightTbl[sq];
if(bKnightTbl[sq] > highBN) highBN = bKnightTbl[sq];
if(wBishopTbl[sq] > highWB) highWB = wBishopTbl[sq];
if(bBishopTbl[sq] > highBB) highBB = bBishopTbl[sq];
if(wRookTbl[sq] > highWR) highWR = wRookTbl[sq];
if(bRookTbl[sq] > highBR) highBR = bRookTbl[sq];
if(wQueenTbl[sq] > highWQ) highWQ = wQueenTbl[sq];
if(bQueenTbl[sq] > highBQ) highBQ = bQueenTbl[sq];
}
for(sq = A1; sq <= H8; sq++) {
if(highWN > 120) wKnightTbl[sq] *= (120 / highWN);
if(highBN > 120) bKnightTbl[sq] *= (120 / highBN);
if(highWB > 120) wBishopTbl[sq] *= (120 / highWB);
if(highBB > 120) bBishopTbl[sq] *= (120 / highBB);
if(highWR > 120) wRookTbl[sq] *= (120 / highWR);
if(highBR > 120) bRookTbl[sq] *= (120 / highBR);
if(highWQ > 120) wQueenTbl[sq] *= (120 / highWQ);
if(highBQ > 120) bQueenTbl[sq] *= (120 / highBQ);
}
}
I am hoping for some ideas to try and some insight that might save me some time. The results for the above code are amazing and I think that with some insightful changes it can become much better.