Forcing play into positions of a specific piece count

Discussion of chess software programming and technical issues.

Moderator: Ras

Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Forcing play into positions of a specific piece count

Post by Cardoso »

Hi everyone,
I have the 6 piece DTM EGTB in RAM (2.6GB) in my portuguese checkers engine (with flying kings), wich offcourse has to be a 64bit exe in order to use more RAM.

I have a variable MaxPieceCount = 6 + 4;

In the eval funcion I have:

Code: Select all

int acumulator=0; //this is the variable that will sum all of the eval terms

   .
   .
   .

if (piececount <= MaxPieceCount ) {
   .
   .
   .
}
I wan't the engine to hang around playing positions with piececount near MaxPieceCount , preferable equal to MaxPieceCount, that is to say avoiding captures once it reaches MaxPieceCount.
Why? Because the search of a position with 10 pieces on the board will have most of it's tips falling in the EGTB database so the engine will play well here and the more pieces on the board the better to keep it complex for the opponent, but not more than MaxPieceCount so that the search may have less tips falling inthe EGTB database and play not so good.
I have the following material wights:
white man = 100
black man = -100
white queen = 345
black queen = -345

So what code should I use above in order to avoid captures once MaxPieceCount has been reached, while encouraging promotions offcourse ?

thanks in advance,
Alvaro
jwes
Posts: 778
Joined: Sat Jul 01, 2006 7:11 am

Re: Forcing play into positions of a specific piece count

Post by jwes »

A simple way would be to have an array that has a weight for every possible number of pieces and put the largest weight in array[MaxPieceCount ] and play with the weights until it does not make bad (or avoid good) trades to keep the piece count near MaxPieceCount .
Cardoso
Posts: 363
Joined: Thu Mar 16, 2006 7:39 pm
Location: Portugal
Full name: Alvaro Cardoso

Thanks (NT)

Post by Cardoso »

nt