Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Opening, Middlegame, Endgame (for authors)

Author: Uri Blass

Date: 10:01:54 06/17/04

Go up one level in this thread


On June 17, 2004 at 12:41:35, Fabien Letouzey wrote:

>On June 17, 2004 at 12:34:43, Uri Blass wrote:
>
>>I still did not implement your interpolation but I think to change it to have 2
>>different numbers for white and black accept cases when both sides have equal
>>material when I can skip the calculation of the second number
>>and I may have something like:
>>//valpieces[0]=value of white pieces not pawns.
>>//valpieces[1]=value of black pieces not pawns.
>
>>phase[0]=calculatephase(valpieces[1])
>>if (valpieces[0]==valpieces[1])
>>phase[1]=phase[0];
>>else phase[1]=calculatephase(valpieces[0]);
>
>>Uri
>
>Hi Uri,
>
>As I mention in another post, I consider using 1 or 15 interpolation
>parameter(s) are the same idea.  I also justify why I use only one while not
>recommending others to do so.
>
>What seems important to me is that there is no clear definition of "phase"
>(which I suspect is what most engines are using).
>
>Fabien.

phase in the code that I plan is the weight of the interpolation(the same as
fruit code.

You have

 phase = TotalPhase;

   phase -= wp * PawnPhase;
   phase -= wn * KnightPhase;
   phase -= wb * BishopPhase;
   phase -= wr * RookPhase;
   phase -= wq * QueenPhase;

   phase -= bp * PawnPhase;
   phase -= bn * KnightPhase;
   phase -= bb * BishopPhase;
   phase -= br * RookPhase;
   phase -= bq * QueenPhase;

the problem that I see is that phase is the same for both sides.

I plan to have something equivalent to

phase[0]= TotalPhase;
phase[1]= TotalPhase;
phase[1] -= wp * PawnPhase;
phase[1] -= wn * KnightPhase;
phase[1] -= wb * BishopPhase;
phase[1] -= wr * RookPhase;
phase[1] -= wq * QueenPhase;
phase[0] -= bp * PawnPhase;
phase[0] -= bn * KnightPhase;
...

The only difference is that it seems to me a waste of time to calculate it again
and again and it seems to me better to update phase[0] and phase[1] in make move
and undo move only after captures of no pawns.

I thought to save time in the previous post by the fact that I already have a
global varaible valpiece[0] and valpieces[1] and in my make move I change
valpieces[0] or valpieces[1] after every capture.

It is possible that global varaibles cost more time and it may be better to get
rid of them and calculate the information when I need it and I do not know.

I do not plan to test it and it is more important not to care now about speed
optimizations.

Uri



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.