notachessplayer wrote:I've been reading books about chess strategy to be able to code my AI properly, but the limit is never clear.
I was wondering what is generally a good time to change the state of the game to middle or end game, in chess programming?
What do stockfish, komodo, houdini do?
When you find out the best way to do it, please share! LOL
this is one of those, "there is no right way" topics.
there are many ways to look at it. i have special code for all 2-3-4 piece endings, so my eval jumps to those whenever detected. I've been reading up on pawn only endings, so perhaps at some point i'll have "ending" code to deal with pawn only. does that mean my "endgame" starts then? not really.
it all depends what you are going to do once you have detected your "endgame". there are examples, such as the test in NULL move that says, if in endgame, don't do NULL move, but you'll have to play around to decide what you like best. one can always find zugzwang positions that will make every endgame cutoff fail. no holy grail here. what defines endgame for NULL move might be wrong elsewhere.
SF does a lot of eval tapering, meaning the score of an eval element changes between the beginning and ending of the game. you could look at it from that perspective on a case by case basis.