I recently discovered a bug (ok an amateurs mistake) in my program. The evaluation function will sometimes return a value of greater than 100 (a pawn is worth 100).
Obviously it was playing some dumb moves. Loosing pieces for a perceived positional advantage.
The eval function uses PST, mobility, doubles/backward/isolated pawns, king safety etc, etc. I have positive values for good things like mobility and negative values for bad things like doubled pawns. I was hoping that the negative values would restrain the positive values from increasing too much.
How can i make sure that in ALL combinations of positions I never exceed 100.
I recently discovered a bug (ok an amateurs mistake) in my program. The evaluation function will sometimes return a value of greater than 100 (a pawn is worth 100).
Obviously it was playing some dumb moves. Loosing pieces for a perceived positional advantage.
The eval function uses PST, mobility, doubles/backward/isolated pawns, king safety etc, etc. I have positive values for good things like mobility and negative values for bad things like doubled pawns. I was hoping that the negative values would restrain the positive values from increasing too much.
How can i make sure that in ALL combinations of positions I never exceed 100.
You can, but you shouldn't. You can always do the ugly
score = Max(Min(score, 100), -100);
But lots of scores SHOULD be > one pawn. King safety. Unstoppable passed pawns. Etc...
lauriet wrote:but for the hundred and one positions that should be less than one pawn...........
does everyone check all these positions so that the value < 100
nobody does that, it's nonsense. you need to adjust (tune) you eval weights.
easier said than done of course.
lauriet wrote:but for the hundred and one positions that should be less than one pawn...........
does everyone check all these positions so that the value < 100
[D]8/8/7k/P5p1/5pKp/8/8/8 w - - 0 1
The unstoppable passer should be worth much more than two pawns in this case.
There are plenty of advantages worth more than a Pawn. If you score positional advantages that are worth less than a Pawn above 100, you should simply lower their score, because then apparently you overestimated them.
There is no logic in the idea that 3 advantages each worth half a Pawn should not add up to 1.5 Pawn. In fact if there is anything non-additive there, it would be that advantages amplify each other, rather than saturate.
I think the danger is in a false "> 100 " positionnal advantage , returned by an evaluation function bad tuned .
We can have a positionnal avantage worth more than a pawn if it is a real avantage right? Unless our engine can't win a game positionaly, it'll search only for a material avantage no?
Here is the dificulty:
It need a good eval very well tuned , it's the game of chess programming , it's all the fun for me : playing with the eval (and the search) 😉