evaluation function complete

Discussion of chess software programming and technical issues.

Moderator: Ras

Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

evaluation function complete

Post by Jan Brouwer »

I am working on my evaluation function, and I've made a shortlist of features which would make the evaluation function more or less complete
(this is mostly from Ed's description "How REBEL plays chess"):

Code: Select all

king
- castling
- pressure
- safe contact check penalty
- early development penalty
- endgame centralisation
queen
- material value
- early development penalty
- centralisation (?)
rook
- material value
- connected rooks
- open file
- 7th rank
- weak edge files (?)
- pinning bonus
- trap penalty
- centralisation (?)
bishop
- material value
- bishop pair
- minimum mobility
- bad bishop
- pinning bonus
- trap penalty
- centralisation
knight
- material value
- minimum mobility
- outpost
- trap penalty
- centralisation
pawn
- material value
- passed
  - connected passed
  - candidate passed
  - blocked passed
  - outside passed
  - immobile passed
  - king support
  - rook support
  - enemy king tropism
- doubled
- connected
- weak
- holes
- pressure
- king shelter
- central pawn development
- pawn advancement
- weak edge files
general
- combined mobility
- centre control
- double attack
- right to move
endgame
- rook pawn ending
- pawn ending
- KPK database
Do you think this list is reasonably complete, or are there features missing which could contribute significantly to playing strength?
(or perhaps features which can be removed because they won't contribute?)

Thanks,
Jan
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: evaluation function complete

Post by Ferdy »

Jan Brouwer wrote:I am working on my evaluation function, and I've made a shortlist of features which would make the evaluation function more or less complete
(this is mostly from Ed's description "How REBEL plays chess"):

Code: Select all

king
- castling
- pressure
- safe contact check penalty
- early development penalty
- endgame centralisation
queen
- material value
- early development penalty
- centralisation (?)
rook
- material value
- connected rooks
- open file
- 7th rank
- weak edge files (?)
- pinning bonus
- trap penalty
- centralisation (?)
bishop
- material value
- bishop pair
- minimum mobility
- bad bishop
- pinning bonus
- trap penalty
- centralisation
knight
- material value
- minimum mobility
- outpost
- trap penalty
- centralisation
pawn
- material value
- passed
  - connected passed
  - candidate passed
  - blocked passed
  - outside passed
  - immobile passed
  - king support
  - rook support
  - enemy king tropism
- doubled
- connected
- weak
- holes
- pressure
- king shelter
- central pawn development
- pawn advancement
- weak edge files
general
- combined mobility
- centre control
- double attack
- right to move
endgame
- rook pawn ending
- pawn ending
- KPK database
Do you think this list is reasonably complete, or are there features missing which could contribute significantly to playing strength?
(or perhaps features which can be removed because they won't contribute?)

Thanks,
Jan
This is a reasonable list to me. The challenge now is on the details like how do you define a rook in 7th rank to get a bonus? because placing a rook in 7th rank is not always good. The second challenge is tuning the values. Ultimate test - create 30k engine versions or more depending on your number of features (search and eval) and test every features that needs to be tested like rook at 7th rank tested at 4 different values, knigth outpost tested at 10 different values, lmr reduction by 1 ply or 2 plies and other plies, do this in every feature that you have, then run 50k games per version, from this we might be be able to find out which eval feature is not needed.
Jan Brouwer
Posts: 201
Joined: Thu Mar 22, 2007 7:12 pm
Location: Netherlands

Re: evaluation function complete

Post by Jan Brouwer »

Ferdy wrote:
Jan Brouwer wrote:I am working on my evaluation function, and I've made a shortlist of features which would make the evaluation function more or less complete
(this is mostly from Ed's description "How REBEL plays chess"):

Code: Select all

king
- castling
- pressure
- safe contact check penalty
- early development penalty
- endgame centralisation
queen
- material value
- early development penalty
- centralisation (?)
rook
- material value
- connected rooks
- open file
- 7th rank
- weak edge files (?)
- pinning bonus
- trap penalty
- centralisation (?)
bishop
- material value
- bishop pair
- minimum mobility
- bad bishop
- pinning bonus
- trap penalty
- centralisation
knight
- material value
- minimum mobility
- outpost
- trap penalty
- centralisation
pawn
- material value
- passed
  - connected passed
  - candidate passed
  - blocked passed
  - outside passed
  - immobile passed
  - king support
  - rook support
  - enemy king tropism
- doubled
- connected
- weak
- holes
- pressure
- king shelter
- central pawn development
- pawn advancement
- weak edge files
general
- combined mobility
- centre control
- double attack
- right to move
endgame
- rook pawn ending
- pawn ending
- KPK database
Do you think this list is reasonably complete, or are there features missing which could contribute significantly to playing strength?
(or perhaps features which can be removed because they won't contribute?)

Thanks,
Jan
This is a reasonable list to me. The challenge now is on the details like how do you define a rook in 7th rank to get a bonus? because placing a rook in 7th rank is not always good. The second challenge is tuning the values. Ultimate test - create 30k engine versions or more depending on your number of features (search and eval) and test every features that needs to be tested like rook at 7th rank tested at 4 different values, knigth outpost tested at 10 different values, lmr reduction by 1 ply or 2 plies and other plies, do this in every feature that you have, then run 50k games per version, from this we might be be able to find out which eval feature is not needed.
For the next version of my program I only intend to change the evaluation function, not the search, so the number of combinations to test will be lowered from "impossibly large", to merely "ludicrously large". So far, I have a relatively simple evaluation function where I make a small incremental change, play a few hundred games, pear into the noise and try to decide if it is an improvement.
So I think I will try a new approach, code up a new and more or less complete evaluation function, give each feature a weight of 0.1 pawn, and be disappointed when it plays slightly worse than the old version :)

I have been reading some articles on internet on chess theory (e.g. articles by Dan Heisman) for new ideas and inspiration...
Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: evaluation function complete

Post by Ferdy »

Jan Brouwer wrote:
Ferdy wrote:
Jan Brouwer wrote:I am working on my evaluation function, and I've made a shortlist of features which would make the evaluation function more or less complete
(this is mostly from Ed's description "How REBEL plays chess"):

Code: Select all

king
- castling
- pressure
- safe contact check penalty
- early development penalty
- endgame centralisation
queen
- material value
- early development penalty
- centralisation (?)
rook
- material value
- connected rooks
- open file
- 7th rank
- weak edge files (?)
- pinning bonus
- trap penalty
- centralisation (?)
bishop
- material value
- bishop pair
- minimum mobility
- bad bishop
- pinning bonus
- trap penalty
- centralisation
knight
- material value
- minimum mobility
- outpost
- trap penalty
- centralisation
pawn
- material value
- passed
  - connected passed
  - candidate passed
  - blocked passed
  - outside passed
  - immobile passed
  - king support
  - rook support
  - enemy king tropism
- doubled
- connected
- weak
- holes
- pressure
- king shelter
- central pawn development
- pawn advancement
- weak edge files
general
- combined mobility
- centre control
- double attack
- right to move
endgame
- rook pawn ending
- pawn ending
- KPK database
Do you think this list is reasonably complete, or are there features missing which could contribute significantly to playing strength?
(or perhaps features which can be removed because they won't contribute?)

Thanks,
Jan
This is a reasonable list to me. The challenge now is on the details like how do you define a rook in 7th rank to get a bonus? because placing a rook in 7th rank is not always good. The second challenge is tuning the values. Ultimate test - create 30k engine versions or more depending on your number of features (search and eval) and test every features that needs to be tested like rook at 7th rank tested at 4 different values, knigth outpost tested at 10 different values, lmr reduction by 1 ply or 2 plies and other plies, do this in every feature that you have, then run 50k games per version, from this we might be be able to find out which eval feature is not needed.
For the next version of my program I only intend to change the evaluation function, not the search, so the number of combinations to test will be lowered from "impossibly large", to merely "ludicrously large". So far, I have a relatively simple evaluation function where I make a small incremental change, play a few hundred games, pear into the noise and try to decide if it is an improvement.
So I think I will try a new approach, code up a new and more or less complete evaluation function, give each feature a weight of 0.1 pawn, and be disappointed when it plays slightly worse than the old version :)

I have been reading some articles on internet on chess theory (e.g. articles by Dan Heisman) for new ideas and inspiration...
Also a good book for chess programmer is "how to reassess your chess" by Silman. In endgame for B vs N, knight is preferable if remaining pawns are in one side of the board only. Principles like if your opponent has an isolated pawn, then exchange minors and retain rooks, the idea is it is easier to attack the weak pawn if opp has no minors. This is very interesting to study computer games if this could also be true.