endgame

Discussion of chess software programming and technical issues.

Moderator: Ras

flok

endgame

Post by flok »

What would be an appropriate estimate to determine if one is in the endgame?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: endgame

Post by sje »

flok wrote:What would be an appropriate estimate to determine if one is in the endgame?
Current total material < 1/3 Original total material
flok

Re: endgame

Post by flok »

sje wrote:
flok wrote:What would be an appropriate estimate to determine if one is in the endgame?
Current total material < 1/3 Original total material
For either color? Or in total?
I mean:
5 or less white objects or 5 or less black objects
OR
10 or less objects in total?
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: endgame

Post by sje »

Total material score, not total pieces of wood.
flok

Re: endgame

Post by flok »

sje wrote:Total
I also heard that you can check if either king has started to move around the board. Should I check for both situations? (e.g. material-check AND king activity check)
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: endgame

Post by sje »

flok wrote:I also heard that you can check if either king has started to move around the board. Should I check for both situations? (e.g. material-check AND king activity check)
That doesn't sound very useful, and it's easy to come up with counterexamples. Most endgame texts say in chapter one something like "when the pieces in the box weigh at least twice as much as the ones on the board, then you're in the endgame".

Another idea: if a typical search will result in tablebase access, then the root position is an endgame position.

Some programs further distinguish among early, middle, and late endgame classes. One could do the same thing with middlegame positions, I suppose.
flok

Re: endgame

Post by flok »

Ok, thanks!
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: endgame

Post by hgm »

In uMax I use totalPieceMaterial <= 10, where P=0, N=B=2, R=3, Q=6. So if both have R+B it is end-game, which means it is safe for the King to come out, and check extension is dropped. It is probably better to only look count opponent pieces, but in the framework of uMax, where size is important, only counting the total saves characters. The idea was that if it is not approximately equal, the game is won or lost anyway.

In Joker I have an intermediate phase between end-game and middle-game, in which the King can move towards the center, but does seek shelter behind own Pawns. I use P=0, B=N=2, R=4, Q=8 there, and it is safe to come out if the opponent totals to less than 8.
Uri Blass
Posts: 10793
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: endgame

Post by Uri Blass »

hgm wrote:In uMax I use totalPieceMaterial <= 10, where P=0, N=B=2, R=3, Q=6. So if both have R+B it is end-game, which means it is safe for the King to come out, and check extension is dropped.
1)I wonder if having complicated rules for extensions does not contradict the target of umax that is to be smaller because I do not think that you can earn a lot of rating points by not having check extensions in the endgame.

2)I wonder if it is not better to use something like totalPieceMaterial<16 because I think that it is usually good to activate the king even in Q vs Q or R+R vs R+R or in R+B+N vs R+B+N

3)Note that the way that top prograqms evaluate position is simply
to have average between opening evaluation and endgame evaluation when the weight of the endgame evaluation in the average is based on the stage of the game and not to have evaluation that has endgame terms only when totalpieceMateria is smaller than something.

Uri
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: endgame

Post by hgm »

I tested in an earlier version of uMax the effect of a check extension. It made it weaker. Only when I disabled the check extension in the end-game, the check extension had a benificial effect. (And enough to warrant the extra characters.)

I might have to retest this to be 100% sure it also holds in the new version. This was tested in self-play at extremely short games (10 moves/sec, or so).

As for coming out when the opponent has Q: I intentionally discouraged that, although I admit that I did not test what the optimum would be here. IMO dropping King safety in the presence of enemy super-pieces is only viable in combination with an eval that penalizes undefended pieces in such positions. I think the difference would be so small here that it would be difficult to test in matches of normal games. I would have to design a test of KQ+Pawns vs KQ+Pawns positions with good King safety for both sides, and then play a few thousand games (pairs with reversed colors) between versions with different thresholds.

I think King-safety evaluation and check extension should be linked. In positions with exposed King, where checks are the norm rather than the exception, a check extension makes little sense. We know that in most endings checks are a waste of time, that will not lead to any progress. Searching deeper on those branches in engines with little or no end-game knowledge helps pushing the reward for good plans over the horizon. And if you think that delivering checks is a waste of time for the opponent, there is no reason to penalize it in the evaluation if he can. And there is no way to gradually switch off the check extension.