ethan ara
Joined: 16 May 2011 Posts: 134 Location: Denmark
|
Post subject: An experimental draw recognizer function Posted: Wed Mar 14, 2012 2:56 pm |
|
|
Hi
When I was walking around, i got this idea for engines to better recognise whether or not a position is draw due to the 50 move rule. The idea is based on the fact that if you cant get a better position/win material et cetera within 50 moves, the game is a draw. Here it is in pseudo-code (in the search function):
| Code: |
if position_is_endgame && saved_before_flag == false then
first_eval_in_endgame = score
saved_before_flag = true
first_eval_in_endgame_depth = depth
|
and later in search, in a further depth
| Code: |
score = evaluate()
eval_difference = first_eval_in_endgame - score
if saved_before_flag == true && eval_difference > Table[depth_difference] then
return draw
|
So, it is basically saying that if you or your opponent don't improve your position with x centipawns in y depth, then it is quite surely a draw.
Table should be something like this:
| Code: |
Table[64] = "5, 7, 10, 13, 15, 17, 20" // and so on....
|
Of course, if you're over a special margin (1½ pawn or so), it will be completely dumb to do this.
The only problems remaining is having good values in table and a good endgame knowledge.
I will test this with doublecheck
Regards
Ethan |
|