Distance to King

Discussion of chess software programming and technical issues.

Moderator: Ras

aberent

Re: Distance to King

Post by aberent »

Thank you :)

Do you guys find king distance to be useful in an evaluation function? Any advice on scoring?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Distance to King

Post by bob »

aberent wrote:Thank you :)

Do you guys find king distance to be useful in an evaluation function? Any advice on scoring?
Lots of places. Are too many pieces close to my king? Is the king too far away from a passed pawn or its queening square? Etc...
aberent

Re: Distance to King

Post by aberent »

bob wrote:
aberent wrote:Thank you :)

Do you guys find king distance to be useful in an evaluation function? Any advice on scoring?
Lots of places. Are too many pieces close to my king? Is the king too far away from a passed pawn or its queening square? Etc...
What kind of scores in terms of % of pawn should I give these? Do you know any good articles on Evaluation Functions?

Thanks
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Distance to King

Post by bob »

aberent wrote:
bob wrote:
aberent wrote:Thank you :)

Do you guys find king distance to be useful in an evaluation function? Any advice on scoring?
Lots of places. Are too many pieces close to my king? Is the king too far away from a passed pawn or its queening square? Etc...
What kind of scores in terms of % of pawn should I give these? Do you know any good articles on Evaluation Functions?

Thanks
No good articles at all. It is all witchcraft, superstition, voodoo, etc. :)

Best answer is to try a reasonable set of values, test, and then modify and repeat the test.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Distance to King

Post by Don »

aberent wrote:Thank you :)

Do you guys find king distance to be useful in an evaluation function? Any advice on scoring?
In Doch there is a penalty for the distance of your king to the square in front of a passed pawn of either color - it applies in the endgame but it's interpolated between opening and endgame phase.

The bonus is quadratic - so you get more credit for moving closer if you are already pretty close.

It's probably also useful to give a small bonus for distance to ALL pawns, at least in late endgame phase. If, for instance if there are pawns only on the b file, you want your king to want to be over there. This is a better rule in most cases than just hard coded king centralization.