Including threats in evaluation
Posted: Fri Dec 30, 2016 5:00 pm
I'm looking at scoring threats in the evaluation function. I already update the attack/defend bit boards when computing mobility and king safety so i'm less concerned about the expense. This is what i'm doing so far:
supported = attacked by an own pawn
defended = attacked by an own piece
Knights:
Score a bonus for attacking an unsupported enemy pawn or bishop, or any attack on enemy rook or queen
Bishops:
Score a bonus for attacking an unsupported enemy pawn or knight, or any attack on enemy rook or queen
Rooks:
Score a bonus for attacking an unsupported enemy pawn, knight or bishop or any attack on enemy queen
Queens:
Score a bonus for attacking an unsupported enemy pawn, knight, bishop or rook
While computing these bonuses i update a bit board of hanging pieces which attract a bonus a well.
I think including threats in evaluation has some obvious benefits. We include so many eval bonuses that are just best guesses in any specific position anyways. I would think attacking unsupported pieces would promote an attacking style and open up some tactical possibilities. The other major benefit i see is in countering some horizon effects. When at D = 1 some threat develops (say we are forked by an enemy knight) we go to quiescence where we decide to stand pat and the loss is ignored. By including threats, the decrease in standpat score may be enough to choose a different path and avoid this.
I have two questions. What size of bonuses have people had success with? Just to give you an idea of what i tried so far, for knights these are the bonuses for attacking various pieces (pawn, bishop, rook, queen). I use higher values for the endgame bonuses.
3, 8, 15, 15 (centipawns)
I want the bonus to be big enough to detect threats when entering qSearch but i don't want to override other eval terms. Specifically i don't want to value chasing pieces around over other positional factors.
And finally, I do a static eval at all internal nodes. How have people used this threat information to improve search? I'm thinking we avoid futility pruning at nodes where we have a big jump in threat score from the previous ply. Anything else?
supported = attacked by an own pawn
defended = attacked by an own piece
Knights:
Score a bonus for attacking an unsupported enemy pawn or bishop, or any attack on enemy rook or queen
Bishops:
Score a bonus for attacking an unsupported enemy pawn or knight, or any attack on enemy rook or queen
Rooks:
Score a bonus for attacking an unsupported enemy pawn, knight or bishop or any attack on enemy queen
Queens:
Score a bonus for attacking an unsupported enemy pawn, knight, bishop or rook
While computing these bonuses i update a bit board of hanging pieces which attract a bonus a well.
I think including threats in evaluation has some obvious benefits. We include so many eval bonuses that are just best guesses in any specific position anyways. I would think attacking unsupported pieces would promote an attacking style and open up some tactical possibilities. The other major benefit i see is in countering some horizon effects. When at D = 1 some threat develops (say we are forked by an enemy knight) we go to quiescence where we decide to stand pat and the loss is ignored. By including threats, the decrease in standpat score may be enough to choose a different path and avoid this.
I have two questions. What size of bonuses have people had success with? Just to give you an idea of what i tried so far, for knights these are the bonuses for attacking various pieces (pawn, bishop, rook, queen). I use higher values for the endgame bonuses.
3, 8, 15, 15 (centipawns)
I want the bonus to be big enough to detect threats when entering qSearch but i don't want to override other eval terms. Specifically i don't want to value chasing pieces around over other positional factors.
And finally, I do a static eval at all internal nodes. How have people used this threat information to improve search? I'm thinking we avoid futility pruning at nodes where we have a big jump in threat score from the previous ply. Anything else?