0

On the chessprogramming wiki site for tapered evaluation, there is the following code snippet for how engines calculate phase:

eval = ((opening * (256 - phase)) + (endgame * phase)) / 256

PawnPhase = 0
KnightPhase = 1
BishopPhase = 1
RookPhase = 2
QueenPhase = 4
TotalPhase = PawnPhase*16 + KnightPhase*4 + BishopPhase*4 + RookPhase*4 + QueenPhase*2

phase = TotalPhase

phase -= wp * PawnPhase // Where wp is the number of white pawns currently on the board
phase -= wn * Knight    // White knights
...
phase -= br * RookPhase
phase -= bq * QueenPhase

phase = (phase * 256 + (TotalPhase / 2)) / TotalPhase

I understand most of the phase evaluation function, but my question is, why are piece phase values scored the way they are? I can see how since pawns are technically not pieces, so pawnPhase has a score of 0, but what is the reasoning behind the other phase values?

2
  • You mean 1, 1, 2, 4?
    – Allure
    Aug 29 at 0:54
  • @Allure yeah, I want to know the reasoning behind why they chose those numbers
    – wdk23
    Aug 29 at 0:59

1 Answer 1

1

Keep in mind that the phase is supposed to distinguish between middlegame and endgame evals. The larger the value of phase, the more impact it has on determining whether we're at an endgame. Human chess knowledge tells you that the fewer pieces there are on the board, the more endgame-ish the game is. Queens leaving the board has the biggest impact, so queens have the largest phase value. The same goes for rooks, etc.

Like with many things in handcrafted eval, the exact numbers are empirically tuned.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.