King position evaluations?

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
SrcEngine
Posts: 2
Joined: Sun Mar 22, 2020 2:04 pm
Full name: Luke Kong

King position evaluations?

Post by SrcEngine » Sat Mar 28, 2020 3:27 am

How do I evaluate the position of the king? During the opening and the middle game, the king should be behind the pawns and at the back ranks. In the end game, however, the king should be more active. How should my engine distinguish between openings and end games?

Dann Corbit
Posts: 10808
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: King position evaluations?

Post by Dann Corbit » Sat Mar 28, 2020 4:22 am

There are different ways to calculate game phase.
An easy way is just to look at the chessman count.
You might like to look at Ed Schroder's page about evaluation, or the chess programming wiki under topic king safety.
https://www.chessprogramming.org/King_Safety
http://members.home.nl/matador/Inside%20Rebel.pdf
https://www.chessprogramming.org/Game_Phases
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Terje
Posts: 166
Joined: Tue Nov 19, 2019 3:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: King position evaluations?

Post by Terje » Sat Mar 28, 2020 1:11 pm


Post Reply